main.obj:-1: error: LNK2001: 无法解析的外部符号 "public: virtual struct QMetaObject const * __thiscall CustomButton::metaObject(void)const " (?metaObject@CustomButton@@UBEPBUQMetaObject@@XZ)
QTCreator 运行时报错
main.obj:-1: error: LNK2001: 无法解析的外部符号 "public: virtual struct QMetaObject const * __thiscall CustomButton::metaObject(void)const " (?metaObject@CustomButton@@UBEPBUQMetaObject@@XZ)
原因:
用到 Q_OBJECT 的类和main都放在main.cpp中;
解决方案
将类单独用类.h 类.cpp 文件中;然后在main.cpp 中包含 类.h
原因2:
如果是之前有错误有修改了,则需要将对应的build目录 例如 build-QStringListModelEx-Desktop_Qt_5_5_1_MSVC2013_32bit-Debug 删除; 再重新build
main.obj:-1: error: LNK2001: 无法解析的外部符号 "public: virtual struct QMetaObject const * __thiscall CustomButton::metaObject(void)const " (?metaObject@CustomButton@@UBEPBUQMetaObject@@XZ)的更多相关文章
- vs2010+qt4编译出现error LNK2001: 无法解析的外部符号 "public: virtual struct QMetaObject等错误
1.当vs2010编译qt时会出现以下错误: 1>------ 已启动全部重新生成: 项目: MyDialog, 配置: Debug Win32 ------ 1>生 ...
- error LNK2001: 无法解析的外部符号 "public: virtual long __stdcall CBaseFilter(转)
原文转自 https://www.cnblogs.com/xiongjiaji/archive/2010/12/31/2476565.html 今天用VS2005编译DirectShow程序,发现出来 ...
- 虚函数 error LNK2001: 无法解析的外部符号 "public: virtual void __cdecl
在虚函数后面加一对大括号 #ifndef CAFFE_CONV_DW_LAYER_HPP_ #define CAFFE_CONV_DW_LAYER_HPP_ #include <vector&g ...
- 无法解析的外部符号 "public: virtual struct CRuntimeClass * _
SetupPropertyPage.obj : error LNK2001: 无法解析的外部符号 "public: virtual struct CRuntimeClass * __this ...
- error LNK2001: 无法解析的外部符号 "public: char * __thiscall
error LNK2001: 无法解析的外部符号 "public: char * __thiscall CamPinPadCtrl::KeysConvert(unsigned long,ch ...
- 【转】strmbasd.lib(dllentry.obj) : error LNK2001: 无法解析的外部符号"int g_cTemplates"
加入了DirectShow的基类链接库后,如果此时编译就会出现以下编译错误: strmbasd.lib(wxutil.obj) : error LNK2019: 无法解析的外部符号 __imp__ti ...
- 引用rtmp编译报错:rtmp.obj : error LNK2001: 无法解析的外部符号 __imp__timeGetTime@0
如题vs下引用librtmp的时候报错:rtmp.obj : error LNK2001: 无法解析的外部符号 __imp__timeGetTime@0 在link 里加入 winmm.lib 就可以 ...
- vs2015编译ffmpeg 出现错误rtmp.lib(rtmp.obj) : error LNK2001: 无法解析的外部符号 ___iob_func
vs2015编译ffmpeg(版本3.0.2)引用外部库文件librtmp出现以下错误: rtmp.lib(rtmp.obj) : error LNK2001: 无法解析的外部符号 __imp__st ...
- 无法链接glew的解决办法-编译开源库出现: error LNK2001: 无法解析的外部符号
无法链接glew的解决办法-编译开源库出现: error LNK2001: 无法解析的外部符号 参考官方配置指南:http://glew.sourceforge.net/install.html 1. ...
随机推荐
- javascript——作用域与闭包
http://www.cnblogs.com/lucio-yr/p/4047972.html 一.作用域: 在函数内部:用 var 声明的表示局部变量,未用var的是全局变量. 作用域取决于变量定义时 ...
- ajax跨域请求-jsonp
1. 同源策略 ajax之所以需要“跨域”,罪魁祸首就是浏览器的同源策略.即,一个页面的ajax只能获取这个页面相同源或者相同域的数据. 如何叫“同源”或者“同域”呢?——协议.域名.端口号都必须相同 ...
- 一个servlet处理多个请求(使用Method的反射机制)
方法一 可以通过在请求的时候加上参数,然后在servlet中获取请求的参数,再去调用对应的方法.达到一个servlet处理多个请求的目的 test.jsp: <%@ page language= ...
- OpenCV笔记 1
Structure Contains Represents CvPoint int x, y Point in image CvPoint2D32f float x, y Points in ...
- 【WebRTC】简介
WebRTC 名称源自网页实时通信(英语:Web Real-Time Communication)的缩写,是一个支持网页浏览器进行实时语音对话或视频对话的API.它于2011年6月1日开源并在Goog ...
- CSS特性:white-space: nowrap;text-overflow: ellipsis;text-decoration: none
/*white-space: nowrap; text-overflow: ellipsis; text-decoration: none;*/ /*这三句话必须连着使用, * clip: 当对象内文 ...
- node Util 模块
该util模块主要设计用于支持Node.js自己的内部API的需求.但是,许多实用程序对于应用程序和模块开发人员也很有用.它可以通过以下方式访问: const util = require('util ...
- Windows系统 为 Visual Studio软件 搭建 OpenCV2 开发环境
Windows系统 为 Visual Studio软件 搭建 OpenCV2 开发环境 我们的电脑系统:Windows 10 64位 Visual Studio 软件:Visual Studio 20 ...
- zedboard:使用ISE和modelsim搭建仿真环境 标签: zedboardfpgamodelsimise 2017-03-03 14:00 528人阅读
详细步骤: 产生ISE仿真库文件 开始->所有程序->xilinx design tools->simulation library compilation wizard.路径可能不 ...
- ZROI2018普转提day2t4
传送门 分析 考场上暴力水过好评... 然后我的st表查询似乎是log的,然后log三方跑的比log方快,qwq. 我们发现如果一个区间的最小值就是这个区间的gcd,则这个区间合法.所以我们二分区间长 ...