T
Tony Johansson
Hello!
I have a class called Outdoors which is a singleton see below for definition
and a main that call this instance method.
Now to my problem this piece of code doesn't compile I get the following
error I can't understand what it is.
start.obj : error LNK2001: unresolved external symbol "private: __thiscall
Outdoors::Outdoors(void)" (??0Outdoors@@AAE@XZ)
Debug/slask.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
#include "outdoors.h"
int main()
{
Outdoors* base = Outdoors::instance();
return 0;
}
//outdoors.h
//********
class Outdoors
{
public:
static Outdoors* instance()
{
if (onlyInstance == 0)
onlyInstance = new Outdoors();
return onlyInstance;
}
private:
Outdoors();
static Outdoors* onlyInstance;
};
Outdoors* Outdoors:nlyInstance = 0;
Many Thanks!
//Tony
I have a class called Outdoors which is a singleton see below for definition
and a main that call this instance method.
Now to my problem this piece of code doesn't compile I get the following
error I can't understand what it is.
start.obj : error LNK2001: unresolved external symbol "private: __thiscall
Outdoors::Outdoors(void)" (??0Outdoors@@AAE@XZ)
Debug/slask.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
#include "outdoors.h"
int main()
{
Outdoors* base = Outdoors::instance();
return 0;
}
//outdoors.h
//********
class Outdoors
{
public:
static Outdoors* instance()
{
if (onlyInstance == 0)
onlyInstance = new Outdoors();
return onlyInstance;
}
private:
Outdoors();
static Outdoors* onlyInstance;
};
Outdoors* Outdoors:nlyInstance = 0;
Many Thanks!
//Tony