天天看點

error LNK2001: unresolved external symbol "protected: virtual struct AFX_EVENTSINKMAP …改正方法。

當出現如下錯誤的時候,解決辦法:

TabSheet.obj : error LNK2001: unresolved external symbol "protected: virtual struct AFX_EVENTSINKMAP const * __thiscall CTabSheet::GetEventSinkMap(void)const " (?G[email protected]@@[email protected]@XZ)

Debug/Prop.exe : fatal error LNK1120: 1 unresolved externals

解決辦法:

因為在該類.h頭檔案中已經聲明DECLARE_EVENTSINK_MAP() ,是以.cpp檔案裡要對應出現相應的實作代碼。

在.cpp中手動添加如下代碼:

BEGIN_EVENTSINK_MAP(CTabSheet, CTabCtrl)  

//{{AFX_MSG_MAP(CTabSheet)

// No message handlers

//}}AFX_MSG_MAP

END_EVENTSINK_MAP()