[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [rtl] RTLinux: C++ static members != good ?
since static means it will not be created with a new operator (or in general
with the constructor)
you always have to instanciate one by using the classname::static variable
=...
in this case it might be
A::a;
or
A::a=0;
somewhere in your code. And this could only be done once, so it usually has
to be in the .cpp file
> my problem comes when I try to make
> int a; //from class A
> static int a;
>
> when I load the module I get an error like
>
> error in b.o : unresolved symbol _1A.a