您的位置:首页 > 其它

解决unresolved external symbol "protected: virtual struct AFX_EVENTSINKMAP const * __thiscall 错误。

2009-11-27 16:44 627 查看
刚开始学习VC++,对它的东西都不懂,其中最使用DECLARE_EVENTSINK_MAP时出现了一个错误,

Linking...
LegendWin.obj : error LNK2001: unresolved external symbol "protected: virtual struct AFX_EVENTSINKMAP const * __thiscall CLegendWin::GetEventSinkMap(void)const " (?GetEventSinkMap@CLegendWin@@MBEPBUAFX_EVENTSINKMAP@@XZ)
Debug/MySuperMap.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

MySuperMap.exe - 2 error(s)
0 warning(s)

因为有 写了代码就编译验证其有没有错误的习惯,所以我在.h文件中申明了DECLARE_EVENTSINK_MAP()以后就编译,却出现错误。

原来是必须在.cpp中写出相应的代码段:

BEGIN_EVENTSINK_MAP(....,....)

相应代码.....

END_EVENTSINK_MAP()

网上搜了好久才找到解决方法的,郁闷。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐