Sign in to follow this  
noatom

Static variables inside a class in a dll?

Recommended Posts

So I have a class inside a dll that has as a member variable a variable from another class in another dll.

That variable was private and the project compiled  fine,now I made it static and public and I get linking problems(with the dll of the class of the static variable).

 

Should static variables inside a dll have a special declaration? Like,__declspec(dllexport) is for functions?

Share this post


Link to post
Share on other sites

There may be issues if you want to share the SAME static variable amongst multiple clients of the DLL though, I'd have to check if that actually works...

 

It is possible to share data sections of a dll, but this is usually not recommended because of potential security issues.

Edited by Nik02

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this