[求助]error LNK2001: unresolved external symbol "private: static int c::x"
#include<iostream>using namespace std;
class c{
public:
void f(){cout<<++x<<endl;}
private:
static int x;
};
int main(){
c c1;
c1.f();
return 0;
}
书上这个简单的程序要求找出错误,我觉得挺正确的呀!运行后出现error LNK2001: unresolved external symbol "private: static int c::x" 请帮帮忙。