Hi guys!
I wanted to test something and wrote this little piece of code:
But now i get this error:
Do I really have to "make" an object out of this class first before I can use this static variable?
What am I doing wrong?
Liduen
PS: I already tried this https://guidedhacking.com/showthread.php?3052-Tutorial-Visual-Studio-Linker-Errors&p=11144&viewfull=1#post11144 and it didn't help.
I wanted to test something and wrote this little piece of code:
C++:
#include <iostream>
#include <windows.h>
#include <math.h>
#include <string>
using namespace std;
class Player{
public:
static int nStaticTest;
};
int main(){
Player::nStaticTest = 1;
cout << Player::nStaticTest << endl;
system("Pause");
}

Do I really have to "make" an object out of this class first before I can use this static variable?
What am I doing wrong?
Liduen
PS: I already tried this https://guidedhacking.com/showthread.php?3052-Tutorial-Visual-Studio-Linker-Errors&p=11144&viewfull=1#post11144 and it didn't help.
Last edited: