无法解析的外部符号 "public: virtual struct CRuntimeClass
来源:互联网 发布:c语言求平方根的算法 编辑:程序博客网 时间:2024/05/17 10:27
无法解析的外部符号 "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错误解决方法
- android中短信协议与字段
- android笔记3——项目文件结构说明
- 失败未必不英雄
- web状态代码详解
- 关闭 C4996 警告
- 无法解析的外部符号 "public: virtual struct CRuntimeClass
- js操作select option
- CCDirector类的成员数据
- 路由器常用配置命令
- 在Service中新开线程和直接新开线程的区别与意义
- MyISAM和Innodb比较
- IOS md5
- 便携式医疗电子将科幻场景搬进生活
- 使用sqlmap进行sql注入