当前位置: 代码迷 >> 综合 >> QT、VS常见bug及解决办法(十)——error LNK2001: 无法解析的外部符号 protected: virtual struct AFX_EVENTSINKMAP
  详细解决方案

QT、VS常见bug及解决办法(十)——error LNK2001: 无法解析的外部符号 protected: virtual struct AFX_EVENTSINKMAP

热度:71   发布时间:2023-11-23 23:37:33.0

错误:

LegendWin.obj : error LNK2001: unresolved external symbol "protected: virtual struct AFX_EVENTSINKMAP const * __thiscall CLegendWin::GetEventSinkMap(void)const " (?GetEventSinkMap@CLegendWin@@MBEPBUAFX_EVENTSINKMAP@@XZ)

修改:

在.h文件中申明了DECLARE_EVENTSINK_MAP()以后,还必须在.cpp中定义相应的代码段:

BEGIN_EVENTSINK_MAP(....,....)才可以。否则就会出现这样的问题。

  相关解决方案