linking static variables
C / C++ / MFC
5
Posts
3
Posters
0
Views
1
Watching
-
Hi, I'm trying to use threads in my app and I should use static variables shared between all threads. Linking the app generates a link error: unresolved symbol static etc... How can I avoid it? Thanks Vilmer
-
I've just declared the veriables as static, but in MyDialog class (where MyDialog is the main dialog class of my app)
If in the .h file for your class you have
class MyClass { static int mStatic; }
Then in the .cpp you will need the followingint MyClass::mStatic = 123;
Mike -
I've just declared the veriables as static, but in MyDialog class (where MyDialog is the main dialog class of my app)