文字列とクラス ポインターを含むマップがあります。私は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