S
sam_cit
Hi everyone,
I have the following code and it gives a linker error on MS vc++ 6.0.
error LNK2001: unresolved external symbol "protected: __thiscall
Singleton::Singleton(void)" (??0Singleton@@IAE@XZ)
#include <stdlib.h>
class Singleton
{
public:
static Singleton* Instance();
protected:
Singleton();
Singleton(const Singleton&);
Singleton& operator= (const Singleton&);
private:
static Singleton* pinstance;
};
Singleton* Singleton:instance = 0;
Singleton* Singleton::Instance()
{
pinstance = new Singleton();
return pinstance;
}
int main()
{
Singleton::Instance();
return(0);
}
Can anyone help in this regard?
I have the following code and it gives a linker error on MS vc++ 6.0.
error LNK2001: unresolved external symbol "protected: __thiscall
Singleton::Singleton(void)" (??0Singleton@@IAE@XZ)
#include <stdlib.h>
class Singleton
{
public:
static Singleton* Instance();
protected:
Singleton();
Singleton(const Singleton&);
Singleton& operator= (const Singleton&);
private:
static Singleton* pinstance;
};
Singleton* Singleton:instance = 0;
Singleton* Singleton::Instance()
{
pinstance = new Singleton();
return pinstance;
}
int main()
{
Singleton::Instance();
return(0);
}
Can anyone help in this regard?