I have the following classA.h
#ifndef ClassAH
#define ClassAH
class A
{
public :
A();
~A();
static std::map< std::string, std::vector< string > > getSomething();
}
#endif
and the implementation in classA.cpp
#include classA.h
std::map< std::string, std::vetor< string > > classA::getSomething()
{
//implementation
return map
}
Now I have another class classB.cpp in which I am doing :
#include classA.h
void method1()
{
std::map< std::string, std::vector< string > > map = classA::getSomething();
}
Note getSomething() is static.
when I compile classB I am getting error LNK2019 on the method getSomething() saying unresolved external symbol ....referenced in method1().
What's going wrong here?