question  Question regarding static pointers as class members

cppuser (73)   Link to this post
Hi all,
I have a class MyClass with one static pointer :

.h :
static SomeOtherClass *test;

.cpp :

SomeOtherClass MyClass::*test= 0;


But when I try to access this static pointer from some other class,
I get a couple of errors :

C:/Documents and Settings/USER/Desktop/workspace/MyProject/someclass.cpp:213: undefined reference to `MyClass::test'

Any ideas where might be the problem ?
cppuser (73)   Link to this post
p.s. :
I'm using another static variable, but it's not a pointer to class and it's not giving any troubles.
Chewbob (95)   Link to this post
SomeOtherClass *myClass::test = 0;
cppuser (73)   Link to this post
Ah, yes... I sometimes hate this syntax. :)

Regards

This topic is archived - New replies not allowed.