Jump to content
  • Advertisement
Sign in to follow this  

DLL export and Singleton

This topic is 4867 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

so, i had stumble on the problem: "needs to have dll-interface to be used by clients..". I solved it with:

#ifdef EXPORT
#define API __declspec(dllexport)  
#define API __declspec(dllimport)  
#define EXPIMP_TEMPLATE extern

EXPIMP_TEMPLATE template class API std::list<CNode*>;

and it works fine, excpet thoose nasty warnings...anyway...no to the problem, i got a Singleton baseclass which includes a static member(the singleton) and the problem is when i use the DLL in my exe file, because there will be 2 instances of this singleton, one in the DLL and one in the exe. Is there any way to solve this? exporting the static member in a way so its only refered to the one in the DLL file? / thanks

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!