You need to call the method using the scope resolution operator - :::
A::getInstance ();
Also, if that means it's singleton, it's very bad. Whenever you call getInstance(), you will get a new object and you will encounter memory leaks if you forget to delete all instances.
The syntax is usually done like this:
class A
{
private:
A () {}
static A* instance;
public:
static A* getInstance ()
{
if ( !instance )
instance = new A ();
return instance;
}
};
A* A::instance = NULL;
source
share