I get lots of indentifier undefined errors even though I'm including them right...
code:
gfunc.h:
#pragma once
#include "image.h"
#include "gclass.h"
int getNextID();
void position(Image img, point2di pos);
void rotate (Image img, int rot);
void point (Image img, Image img2, int offset);
image.h:
#pragma once
#include "gclass.h"
#include "gfunc.h"
class Image{
int id, spriteid;
int w, h;
point2di pos;
int rot;
public:
Image():id(getNextID()), spriteid(getNextID()),
pos(point2di(0,0)),rot(0),w(0),h(0){};
Image(point2di position, int rotation, char* imagefile,
int wwidth, int hheight, bool animated);
int ID(){return id;}
int spriteID(){return spriteid;}
int width(){return w;}
int height(){return h;}
point2di position(){return pos;}
int rotation(){return rot;}
};
error:
------ Build started: Project: Dark GDK - Test Game, Configuration: Debug Win32 ------
Compiling...
image.cpp
c:\documents and settings\tom\my documents\visual studio 2008\projects\project1\project1\dark gdk - test game\dark gdk - test game\gfunc.h(7) : error C2065: 'Image' : undeclared identifier
c:\documents and settings\tom\my documents\visual studio 2008\projects\project1\project1\dark gdk - test game\dark gdk - test game\gfunc.h(7) : error C2146: syntax error : missing ')' before identifier 'img'
c:\documents and settings\tom\my documents\visual studio 2008\projects\project1\project1\dark gdk - test game\dark gdk - test game\gfunc.h(7) : error C2182: 'position' : illegal use of type 'void'
c:\documents and settings\tom\my documents\visual studio 2008\projects\project1\project1\dark gdk - test game\dark gdk - test game\gfunc.h(7) : error C2059: syntax error : ')'
c:\documents and settings\tom\my documents\visual studio 2008\projects\project1\project1\dark gdk - test game\dark gdk - test game\gfunc.h(8) : error C2065: 'Image' : undeclared identifier
c:\documents and settings\tom\my documents\visual studio 2008\projects\project1\project1\dark gdk - test game\dark gdk - test game\gfunc.h(8) : error C2146: syntax error : missing ')' before identifier 'img'
c:\documents and settings\tom\my documents\visual studio 2008\projects\project1\project1\dark gdk - test game\dark gdk - test game\gfunc.h(8) : error C2182: 'rotate' : illegal use of type 'void'
c:\documents and settings\tom\my documents\visual studio 2008\projects\project1\project1\dark gdk - test game\dark gdk - test game\gfunc.h(8) : error C2059: syntax error : ')'
c:\documents and settings\tom\my documents\visual studio 2008\projects\project1\project1\dark gdk - test game\dark gdk - test game\gfunc.h(9) : error C2065: 'Image' : undeclared identifier
c:\documents and settings\tom\my documents\visual studio 2008\projects\project1\project1\dark gdk - test game\dark gdk - test game\gfunc.h(9) : error C2146: syntax error : missing ')' before identifier 'img'
c:\documents and settings\tom\my documents\visual studio 2008\projects\project1\project1\dark gdk - test game\dark gdk - test game\gfunc.h(9) : error C2182: 'point' : illegal use of type 'void'
c:\documents and settings\tom\my documents\visual studio 2008\projects\project1\project1\dark gdk - test game\dark gdk - test game\gfunc.h(9) : error C2059: syntax error : ')'
gclass.cpp
Main.cpp
gfunc.cpp
c:\documents and settings\tom\my documents\visual studio 2008\projects\project1\project1\dark gdk - test game\dark gdk - test game\image.h(11) : error C3861: 'getNextID': identifier not found
c:\documents and settings\tom\my documents\visual studio 2008\projects\project1\project1\dark gdk - test game\dark gdk - test game\image.h(11) : error C3861: 'getNextID': identifier not found
Generating Code...
Build log was saved at "file://c:\Documents and Settings\tom\My Documents\Visual Studio 2008\Projects\Project1\Project1\Dark GDK - Test Game\Dark GDK - Test Game\Debug\BuildLog.htm"
Dark GDK - Test Game - 14 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
I wanna know why it's giving me these errors
and help would be apprecieted
#ifdef __NEWBIE__
MakeAnAwesomeGame(lots of badies, lots of guns, lots of stuff to do, BIG level)
#endif