libFoo-Bar error LNK2001: unresolved external symbol "private: static class MSGTMS:ObjectManager * MSGTMS::ObjectPostManager::m_instance" (?m_instance@ObjectManager@MSGTMS@@0PAV12@A)
The Singleton class looks like this
Expand|Select|Wrap|Line Numbers
- #define LIBMSGTM_Managers_EXPORT __declspec (dllexport)
- namespace MSGTMS
- {
- class LIBMSGTM_Managers_EXPORT ObjectManager
- {
- public:
- static ObjectManager* instance()
- {
- if (m_instance==0)
- m_instance=new ObjectManager;
- return m_instance;
- }
- void destroy()
- {
- if (m_instance!=0)
- delete m_instance;
- }
- bool updateFPStatus(const unsigned int FPindex, FencePostStatus& fpStatus);
- bool updateFP(const unsigned int FPindex, FencePost& fp);
- bool isFPActive(const unsigned int FP);
- bool getFP(const unsigned int FPindex, FencePost& fp);
- bool getUpdatedStatus(bool* arrayEightFencePosts);
- bool getUpdatedPosition(bool* arrayEightFencePosts);
- bool deleteFP(const unsigned int FPindex);
- protected:
- ObjectManager();
- ~ObjectManager();
- Object m_Object[8];
- private:
- static ObjectManager* m_instance;
- CRITICAL_SECTION cs; //For multithreading protection
- };
- }//namespace MSGTMS
- Implementation
- namespace MSGTMS
- {
- ObjectManager* ObjectManager::m_instance=0;
- //Constructor Destructor and other things implemented
- }
Should I be doing something else to a static variable in a dll?