hiho@ll
i had the same problem like this poster:
http://coding.derkeiler.com/Archive/...4-01/1176.html
and i did it like posted there
so, i have a solution to my problem
but i want to know why it is such a problem to have a pointer for a singleton pattern in C++?
i did the same stuff in Visual C++ and it worked great
but with gcc i get "undefined reference" for my instance pointer
it's exactly like the post above
but why?
now i'm using the reference operator and a "local" static instance of my class and it works
but why is it such a problem to do
MyClass::getInstance(){
if(MyClass::instance==NULL)
MyClass::instance=new MyClass();
return instance;
}
instead of
MyClass::getInstance(){
static MyClass theonlyone;
return theonlyone;
}
thx@ll