Jump to content
  • Advertisement
Sign in to follow this  
Axiverse

Setting Static Members inside Classes

This topic is 5045 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'm having trouble using a static cariable inside a class It goes something like this:
class MyClass
{
	static LPDIRECT3D9 localSystem;
};
but when i compile it says: Test.obj : error LNK2019: unresolved external symbol "public: static struct IDirect3D9 * MyClass::localSystem" ... and if I put static LPDIRECT3D9 localSystem = NULL; it says i can't intilize things inside classes Any suggestions?

Share this post


Link to post
Share on other sites
Advertisement
Add a matching variable definition in the cpp file associated with your class.

LPDIRECT3D9 MyClass::localSystem = NULL;

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!