Jump to content
  • Advertisement
Sign in to follow this  

Static class members in static libaries

This topic is 4890 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 looked about, but I've not managed to find anything. In C++, what are the rules that determine whether a static class member will be instantiated or not, when it's in a static library? What I'm trying to do, is have give a class a static member, that automatically registers the class with an abstract factory in its constructor. The class is in one library, the code that uses the factory is in another, the main program links with both libraries. This technique worked fine in an old project, where everything was in the one project, but when I run the program, the static member never gets constructed. Anyone got any ideas? I'm using MS Visual Studio 2002, if it's relevant.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!