Подскажите почему не линкуется:
a.h
class a{
static int x;
public:
static void Set_X(int);
};
a.cpp
#include a.h
void a::Set_X (int n)
{
x = n;
}
В a.o компилится нормально,а
g++ first.cpp a.o -o first
пишет:
a.o: undefine reference to a::x