This problem has made me feel blue, and I can't work out how to fix it.
class A{
public:
static int get_A() {
return a;
}
static int get_B() {
return b;
}
static int a;
static int b;
};
int main() {
int c = A::get_A();
return 0;
}
I wanna use static an in static method get_A(), but I got compiling error as below. (please forgive me using the meanless variable name in the program like above)
Undefined symbols for architecture x86_64:
"A::a", referenced from:
A::get_A() in main.o