我有一个带有字符串和类指针的地图。我来自JAVA,所以请指导我。
class Client {
public:
static map<string, Client*> CLIENTS;
Client(string dir);
static Client* get_client(string name);
virtual ~Client();
};
我的 get_client 方法是
Client* Client::get_client(string name) {
map<string, Client*>::iterator it = CLIENTS.find(name);
}
给我下面的错误
Undefined symbols for architecture x86_64:
"Client::CLIENTS", referenced from:
Client::get_client(std::basic_string<char, std::char_traits<char>, std::allocator<char> >)in client.o
ld: symbol(s) not found for architecture x86_64
collect2: ld returned 1 exit status