关于CMap的问题,总有错误,请知道的兄弟进来看看!
#include "afxtempl.h"
class CServer
{
public:
static CMap<UINT,UINT, CServer *,CServer *> TimerMap;
CreateServer();
UINT uTimerID;
}
CServer::CreateServer()
{
uTimerID = 1;
TimerMap.SetAt(uTimerID,this);
//或者如下
//TimerMap[uTimerID] = this;
}
连接时为什么总有以下错误?难道我的用法不对?请指教。
Linking...
Server.obj : error LNK2001: unresolved external symbol "public: static class CMap<unsigned int,unsigned int,class CServer *,class CServer *> CServer::TimerMap" (?TimerMap@CServer@@2V?$CMap@IIPAVCServer@@PAV1@@@A)
Debug/SSMain.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.