Sign in to follow this  
Whorse

Singleton Unresolved External in Other Library

Recommended Posts

Hey there everyone, busy implementing a globals class with all the singletons I need in my "Engine" project. I had handled this differently prior, but felt it needed redoing. My issue now is that my "Game" project links to the engine library, however when I attempt to compile it it moans about the static singletons in the Globals.h being unresolved externals.

This is the rough layout of my Globals.h. I'm not quite sure why I'm getting linkage issues with my "Game" project (which doesn't even use any of the singletons at the moment), yet my "Engine" project compiles perfectly. Anyone have any hints as to why this could be happening?

[code]
class Globals
{
public:

static void Initialise();
static void Destroy();

static Singleton* GetSingleton()
{
return singleton;
}

private:

static Singleton *singleton;
};
[/code]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this