Skip to main content
gamedev.net
🔒 Locked

Singleton inside a DLL

Started by GiovanniFreda 3 replies 1.3k views
Original Post
GiovanniFreda
GiovanniFreda
I am trying to use a singleton that is defined in a DLL outside of the DLL directly. I have tried exporting the Singleton but I get a linker error in the App using the singleton when I make the call to get the singleton object... Anybody know how to correctly do this, not much help out there for this. class __declspec(dllexport) CRenderManager { protected: static CRenderManager * m_pRender; } Error 17 error LNK2001: unresolved external symbol "protected: static class CRenderManager * CRenderManager::m_pRender" that is the error I receive...
xjyhust
xjyhust
You can try this:
add this line
CRenderManager * CRenderManager::m_pRender;
only in your .cpp file;
GiovanniFreda
GiovanniFreda
in the .cpp for the render manager file or the file i am trying to use the render manager in?

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.