I think you should put the extern's in module.h, declare them without extern in the corresponding .cpp file. ie:
Code:
//module.h
class Module
{
//...
}
extern Module* GameMod;
//...
Code:
//GameModule.cpp
Module* GameMod;
//...
Then you need to allocate those with new (probably in some initialization function (in GameLoop.cpp i guess):
Code:
Module* this_file_gamemod = GameMod; //don't confuse the two
void Startup()
{
GameMod = new GameModule();
this_file_gamemod = GameMod;
}
void GameLoop()
{
Module* oldmod = this_file_gamemod;
//...
}
void ShutDown()
{
delete GameMod;
}