I have below code and I am getting undefined reference to `StInit::instance()'
File StInit.h
class StInit
{
public:
static StInit* instance();
};
File StInit.cc
#include "StInit.h"
StInit*
StInit::instance()
{
static StInit *myPtr = NULL;
......
......
return myPtr;
}
File nm.cc
#include "StInit.h"
StInit* stor_init = StInit::instance();
I don't know why I am getting this error. How to resolve this error?