1、error: C2338: The slot requires more arguments than the signal provides.
原因:connect 信号和槽参数不匹配
2、…\opencv\build\include\opencv2\core\mat.hpp:1965:
warning: C4819: 该文件包含不能在当前代码页(936)中表示的字符。请将该文件保存为 Unicode 格式以防止数据丢失。
原因:编码冲突
解决方法:在包含opencv文件的最前面,添加代码# pragma warning (disable:4819)
3、warning: no previous extern declaration for non-static variable ‘flag’
以前没有非静态变量flag的外部声明
原因:之前在定义一个全局变量的时候,直接在window.cpp中进行了int flag;的定义,之后在main.c中需要用这个变量的时候,直接加了extern int flag;,编译后产生上述警告。
解决方法:
如果只在一个文件中使用该全局变量:
在window.h中进行静态全局变量的定义static int flag;
如果需要在几个文件中同时使用该全局变量:
步骤1. 在window.h中定义extern int flag;
步骤2. 在main.c中添加头文件#include “window.h”,
步骤3. 在main.c中定义int flag;
原因和解决方案来源 : Qt:解决 warning: no previous extern declaration for non-static variable ‘XXX‘.
原作者:Gabriel.Tian的博客.
4、warning: ‘CameraInterface’ has virtual functions but non-virtual destructor
警告:“camerainterface”具有虚拟函数,但不是虚拟析构函数