无法解析的外部符号 "public: virtual struct CRuntimeClass
来源:互联网 发布:泰国香米 知乎 编辑:程序博客网 时间:2024/05/18 06:22
原博地址:http://blog.csdn.net/changbaolong/article/details/8479775
无法解析的外部符号 "public: virtual struct CRuntimeClass * __thiscall CMessageBox::GetRuntimeClass(void)const "
以下原因是会引起上述错误的:
1,在.h文件中写了DECLARE_DYNAMIC,而在.cpp文件中没有写IMPLEMENT_DYNAMIC
2,在.h文件中写了DECLARE_DYNCREATE ,但在.cpp文件中没有写上IMPLEMENT_DYNCREATE
在编写自定义类时,你必须知道,如果在类定义中包含了DECLARE_DYNAMIC,那你必须在类声明中包含IMPLEMENT_DYNAMIC;如果在类定义中包含了DECLARE_DYNCREATE,你必须在类声明中包含IMPLEMENT_DYNCREATE
.h类中定义
DECLARE_DYNCREATE(CMyWinThread)
DECLARE_MESSAGE_MAP()
.cpp类中定义
IMPLEMENT_DYNAMIC(CMyWinThread,CWinThread)
BEGIN_MESSAGE_MAP(CMyWinThread, CWinThread)
END_MESSAGE_MAP()
只需要记住:消息映射在.h文件和.cpp文件中是一一对应的。
阅读全文
0 0
- 无法解析的外部符号 "public: virtual struct CRuntimeClass
- 无法解析的外部符号 "public: virtual struct CRuntimeClass
- 无法解析的外部符号 "public: virtual struct CRuntimeClass
- LNK2001:无法解析的外部符号 "public: virtual struct CRuntimeClass *
- 无法解析的外部符号 "public: virtual struct CRuntimeClass
- 错误:无法解析的外部符号"public:virtual struct CRuntimeClass...."
- 无法解析的外部符号 "public: virtual struct CRuntimeClass
- MFC 创建UI 线程 || 无法解析的外部符号 "public: virtual struct CRuntimeClass
- error LNK2001: 无法解析的外部符号 "public: virtual struct QMetaObject const * __thiscall Widget::metaObject
- error LNK2001: 无法解析的外部符号 "public: virtual struct QMetaObject const * __thiscall Widget::metaObject
- error LNK2001: 无法解析的外部符号 "public: virtual struct QMetaObject const * __thiscall
- error LNK2001: 无法解析的外部符号 "public: virtual struct QMetaObject const * __thiscall MainWindow::metaObje
- QT error LNK2001: 无法解析的外部符号 "public: virtual struct QMetaObject const * __thiscall Widget::metaObjec
- error LNK2001: 无法解析的外部符号 "public: virtual struct QMetaObject const * __thiscall Widget::metaObject
- error LNK2001: 无法解析的外部符号 "public: virtual struct QMetaObject const * __cdecl MainWindow::metaObject(
- error LNK2001: 无法解析的外部符号 "public: virtual struct QMetaObject const * __thiscall ****::metaObj
- vs2010+qt4编译出现error LNK2001: 无法解析的外部符号 "public: virtual struct QMetaObject等错误
- QT中添加Q_OBJECT时编译提示obj : error LNK2001: 无法解析的外部符号 "public: virtual struct QMetaObject const错误解决方法
- 网友:国产军用集成电路的真实水平惨不忍睹
- leetcode 58:Length of Last Word
- Pixhawk---烧写FMU/IO bootloader
- [LeetCode] 107. Binary Tree Level Order Traversal II
- loadrunner之常用函数()
- 无法解析的外部符号 "public: virtual struct CRuntimeClass
- 自学 Java 怎么入门?
- virutalenvwrapper 简单使用
- InvocationHandler和Proxy(Class)的动态代理机制详解
- 设计模式子普通工厂模式
- 自定义带加号的tabBar
- jmeter个人学习之路--工具简单介绍
- Android使用ListView实现滚轮的动画效果
- [hdu1576]: A/b (扩展欧几里得)