• Advertisement

Archived

This topic is now archived and is closed to further replies.

Singleton and dllexport

This topic is 5301 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

I''ve implemented the Singleton class shown in the Game programming Gems 1. I want to dllexport a class deriving from that singleton and I get an error ( base class not exported ) I''ve exported the template but nothing change. Any idea? Crazyjul

Share this post


Link to post
Share on other sites
Advertisement
Yeah, have you seen the Ogre source. ogre.sourceforge.net

basically it requires you to override a method from the base class.

Override the getSingleton() method in your derived class
i.e.

DerivedClass& DerivedClass::getSingleton()
{
return Singleton<DerivedClass>::getSingleton();
}

also, in the cpp file place this line

template<> DerivedCLass* Singleton<DerivedClass>::mInstance = 0;



Can anyone explain exactly what that line above is for??




[edited by - gommo on August 19, 2003 9:39:57 PM]

Share this post


Link to post
Share on other sites
crazyjul: Sorry dude, I didnt use source tags so my post above was missing the template bits, I edited it, so have alook again

Share this post


Link to post
Share on other sites

  • Advertisement