class test_struct {
static int number;
public:
static void set() {
number = 42;
}
};
int main() {
test_struct::set();
}
错误是:
[...]Temp\ccGGxEAz.o:test.cpp:(.text.startup+0xf): undefined reference to `test_struct::number'
collect2.exe: error: ld returned 1 exit status