OK, this is stupid...
Hello. I have a stupid problem I hope someone can help with. I have a CApp class. Contained in that are all my game management objects (such as the input reader, scene graph, etc.) along with game objects (like my global camera, and the key bindings table). Needless to say, other game objects, like CPlayer, need to be able to access this CApp object (to get input, query about game objects, etc), and it needs to know about them (to create them). I put a global forward declaration to my CApp class, but I get the compiler error "use of undefined type 'CApp'" whenever I try to use access any CApp function from a game object. I know there's a solution, but I've got some kind of mental block, and I can't think. Any ideas how I can resolve this problem? If I haven't made myself clear, ask for more specifics...
in CApp.h:
class CPlayer;
class CApp { ... }
in CPlayer.h:
class CApp;
class CPlayer { ... }
in CApp.cpp & CPlayer.cpp:
#include "CApp.h"
#include "CPlayer.h"
class CPlayer;
class CApp { ... }
in CPlayer.h:
class CApp;
class CPlayer { ... }
in CApp.cpp & CPlayer.cpp:
#include "CApp.h"
#include "CPlayer.h"
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement