I need to have a uniq map object to store key-vlaue globally. So I created a class with a static unordered_map as the member, my code as following please:
class PopMap {
public:
static unordered_map<string, string> dataMap;
PopMap(){};
~PopMap(){};
};
int main(){
PopMap::dataMap["name"]="Tom";
return 0;
}
But I got the following exception: undefined reference to PopMap::dataMap