antaren
asked on
Linker Problem, Please Help: Skeleton.obj : error LNK2001: unresolved external symbol "protected: static class GameEngine * GameEngine::m_pGameEngine" (?m_pGameEngine@GameEngine@@1PAV1@A)
I am creating a simple game engine, to get my feet wet.
The program I've created compiles, but it does not link correctly. It gives the following error:
Skeleton.obj : error LNK2001: unresolved external symbol "protected: static class GameEngine * GameEngine::m_pGameEngine" (?m_pGameEngine@GameEngine @@1PAV1@A)
I've google'ed for a solution, but all the results come back about missing library dependancies or directions on including header files into the project, neither of which I believe to be the problem.
I'm pritty sure its a problem with how I'm using the GameEngine class in my program. Here is the main referance for the member variable m_pGameEngine:
In class GameEngine
// GetEngine method allows outside access to the GameEngine pointer
static GameEngine* GetEngine() { return m_pGameEngine; };
In GameEngine::GameEngine()
// Set the member variables for the game engine
m_pGameEngine = this;
Thanks for the help.
The program I've created compiles, but it does not link correctly. It gives the following error:
Skeleton.obj : error LNK2001: unresolved external symbol "protected: static class GameEngine * GameEngine::m_pGameEngine"
I've google'ed for a solution, but all the results come back about missing library dependancies or directions on including header files into the project, neither of which I believe to be the problem.
I'm pritty sure its a problem with how I'm using the GameEngine class in my program. Here is the main referance for the member variable m_pGameEngine:
In class GameEngine
// GetEngine method allows outside access to the GameEngine pointer
static GameEngine* GetEngine() { return m_pGameEngine; };
In GameEngine::GameEngine()
// Set the member variables for the game engine
m_pGameEngine = this;
Thanks for the help.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks allot man.
Initialized it before any function calls, and it works like a charm now.
Initialized it before any function calls, and it works like a charm now.
In this case, the pointer will be initialized to NULL, then, in the constructor will be re-initialized to the proper value.