Hello! :)
I'm trying to achieve an 'engine' of a kind in a DLL project. I have successfully made a DLL that works, but as simple as Hello World.
Now I'm coding a framework into the DLL project, but I'm having some trouble with the singleton function.
Im getting this linker error:
DLLProject.obj : error LNK2001: unresolved external symbol "public: static class MyDLL::Framework * MyDLL::Framework::ofManager" (?ofManager@Framework@MyDLL@@2PAV12@A)
DLLProject.h
namespace MyDLL
{
class Framework
{
public:
static __declspec(dllexport) Framework* ofManager;
Framework();
~Framework();
static __declspec(dllexport) Framework* createManager();
static __declspec(dllexport) Framework* getSingletonPtr()
{
return ofManager;
};
...
private:
...
};
}
DLLProject.cpp
#include "DLLProject.h"
namespace myDLL
{
Framework::Framework()
{
ofManager = this;
}
Framework* Framework::createManager()
{
if(ofManager == 0) ofManager = new Framework();
return ofManager;
}
...
Hope anyone can help, I'm really putting my hair out over this, and hoped that the time invested would not get me asking for help, but oh ;)