I am getting linking error when I build the project. I have a static member pointer which I am setting from a static member function. Any ideas what's the problem
class Logger
{
private:
static MyComp* pComp;
public:
static void setComp(MyComp* comp);
// more methods ..
};
void Logger::setComp(MyComp* comp)
{
pComp = comp;
}
Get the linking error
Undefined symbols for architecture x86_64:
"Logger::pComp", referenced from:
Logger::setComp(MyComp*) in Logger.o