I'm doing a little game in OpenGL for college and I've got these 3 classes in C++:
WarBalls - represents the Game's Application. It is supposed to be a singleton and holds all the Game's Managers.
Expand|Select|Wrap|Line Numbers
- #ifndef WARBALLS_H
- #define WARBALLS_H
- #include "cg/cg.h"
- #include "ControllerManager.h"
- #include "CameraManager.h"
- #include "GameManager.h"
- #include "Light.h"
- #include "NxPhysics.h"
- #include "ErrorStream.h"
- namespace wbproject
- {
- class WarBalls : public cg::Application
- {
- private:
- static WarBalls* instance;
- protected:
- NxPhysicsSDK* _gPhysicsSDK;
- public:
- WarBalls();
- ~WarBalls();
- static WarBalls* getInstance();
- void createEntities();
- CameraManager* getCameraManager();
- NxPhysicsSDK* getPhysics();
- };
- }
- #endif
Expand|Select|Wrap|Line Numbers
- #ifndef CAMMANAGER_H
- #define CAMMANAGER_H
- #include "cg/cg.h"
- #include "FreeCam.h"
- #include "PanoCam.h"
- #include "FollowCam.h"
- #include "GameManager.h"
- namespace wbproject{
- class CameraManager : public cg::Group,
- public cg::GroupDraw,
- public cg::GroupUpdate,
- public cg::GroupReshapeEvent,
- public cg::GroupMouseEvent
- {
- protected:
- void createEntities();
- void postInit();
- public:
- CameraManager(std::string id);
- ~CameraManager();
- void switchCamera(int activeCam);
- };
- }
- #endif
Expand|Select|Wrap|Line Numbers
- #ifndef GAMEMANAGER_H
- #define GAMEMANAGER_H
- #include "cg/cg.h"
- #include "Ball.h"
- #include "Box.h"
- #include "Force.h"
- #include "Level.h"
- #include "Wall.h"
- #include "NxPhysics.h"
- namespace wbproject{
- class GameManager : public cg::Group,
- public cg::GroupDraw,
- public cg::GroupUpdate
- {
- protected:
- void createEntities();
- void postInit();
- public:
- GameManager(std::string id);
- ~GameManager();
- };
- }
- #endif
- I'm using VS 2008's VC++;
- the OpenGL libraries, GLU and GLUT are wrapped by a library provided by the teachers (that's the cg/cg.h);
- And the include of the "NXPhysics. h" is for the Nvidia's PhysX engine, but there is nothing implemented to use it yet;
Now, here is my problem:
I'm getting this error: "...\warballs.h (27) : error C2143: syntax error : missing ';' before '*'"
Everything was fine, until I had to "use" the GameManager inside the CameraManager class.
If i remove the "#include "GameManager.h" " from the CameraManager.h , the errors I get are those for not having the include (like "'GameManag er' : undeclared identifier").
I tried to not "replicate" the "#include "GameManager.h" " removing it from the WarBalls.h (since I have the "ifndef's", should do just the same, right?), but nothing changed....
I found another post about the same error in which someone said to check the ";" after the end of the classes definition (double checked it, but no luck...)
This is the first time I'm working in C++ (I'm more used to Java), and this seems like something very simple, but that I'm not aware of in the including inner process of C/C++...
Thanks in advance.