qt ISO C++ forbids declaration of 'XXXX' with no type
error: ISO C++ forbids declaration of 'XXXX' with no type
出现这个错误,一般是由于两个CPP相互都相互包含了对方的头文件造成的,比如:
当mainwindow.cpp、configdialog.cpp两个文件,分别包含了对方的头文件,并且分别又在自己的类中生命了对象,即:
mainwindow.cpp
#include "configdialog.h"
class MainWindow {
ConfigDialog *configDialog;
};
configdialog.cpp
#include "mainwindow.h"
class ConfigDialog {
MainWindow *mainWindow;
};
解决方法是,在生命对象的类名称前追加关键字“class”,即修改如下:
mainwindow.cpp
#include "configdialog.h"
class MainWindow {
class ConfigDialog *configDialog;
};
configdialog.cpp
#include "mainwindow.h"
class ConfigDialog {
class MainWindow *mainWindow;
};
qt ISO C++ forbids declaration of 'XXXX' with no type的更多相关文章
- ISO C90 forbids mixed declarations and code 警告
编译的时候经常会遇到 ISO C90 forbids mixed declarations and code 警告百度了一下,知道是如下原因 : 变量定义之前任何一条非变量定义的语句(注意:语句是 ...
- warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
在C++中, char* p = "abc"; // valid in C, invalid in C++ 会跳出警告:warning: ISO C++ forbids conve ...
- warning: ISO C++ forbids converting a string constant to 'char*'
第1种字符串赋值方式: char * fileName="./2017-09-02-10-34-10.xml";//这一种字符串赋值方式已经被ISO禁止了 第2种字符串赋值方式: ...
- warning:ISO C90 forbids mixed declarations and code
warning:ISO C90 forbids mixed declarations and code 变量定义之前不论什么一条非变量定义的语句(重视:语句是会带分号的)都会引起这个警告! 将非变量的 ...
- grub2挂在iso镜像“ /dev/disk/by-label/XXXX error: boot device didn't show up after 30 seconds”问题
两种解决办法: 方法A: mkdir /cdrom mount -t vfat /dev/sda1 /cdrom modprobe loop losetup /dev/loop6 /cdrom/boo ...
- [Error] ISO C++ forbids comparison between pointer and integer
错误代码: if(a[i]=="G"&&b[i]!="C") return false; 改正后的代码: if(a[i]=='G'&&a ...
- Qt - 错误总结 - QObject::connect: Cannot queue arguments of type 'PVCI_CAN_OBJ' (Make sure 'PVCI_CAN_OBJ' is registered using qRegisterMetaType().)
背景:一个线程通过signal-slot发送PVCI_CAN_OBJ类型的值到主线程中, 错误提示: QObject::connect: Cannot queue arguments of type ...
- Check类之duplicate declaration checking/Class name generation/Type Checking
1.duplicate declaration checking /** Check that variable does not hide variable with same name in * ...
- 转:QT 的点点滴滴 错误总结
转自:http://blog.csdn.net/lbsljn/archive/2009/12/29/5099590.aspx MinGw + CodeBlock + QT4.5 类定义后面要加&quo ...
随机推荐
- visio开发者图形分类个人爱好
visio开发者图形分类个人爱好
- PHP:第二章——PHP中的foreach语句
foreach语句提供了遍历数组的 <?php header("Content-Type:text/html;charset=utf-8"); $arr=array(&quo ...
- RTU命令设置笔记
YN+12VCTL=1 配置+12V输出控制模式:永久输出YN+5VCTL=1 配置+5V输出控制模式:永久输出 YN+GETDATA 读取采样值 YN++LIST 获取设置参数列表 YN+LOAD ...
- Lightbox JS v2.0图片切换效果
代码下载
- 做了一个vue的同步tree 的npm组件包
前言:因为现成的tree组件没有找到.亦或是其依赖的其他东西太多,不太合适引入我们的项目,所以自己做了一个.大概样式: 在线例子: https://hamupp.github.io/t-vue-tre ...
- radio属性添加
经常会遇到js控制radio选中和切换的问题 之前一直使用的是checked属性来完成的 但是现在发现这个属性有个大问题 今天就是用js给选中radio的赋值,使用的$().attr("ch ...
- linux-*.filetype.bz2 unzip
how to unzip *.bz2 file? wget http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2 unzip ...
- Redis的持久化策略
Redis 持久化: 提供了多种不同级别的持久化方式:一种是RDB,另一种是AOF. RDB 持久化可以在指定的时间间隔内生成数据集的时间点快照(point-in-time snapshot). AO ...
- windows7所有版本迅雷地址下载集合(含32位和64位) - imsoft.cnblogs
Windows7 SP1旗舰版 32位官方原版下载: ed2k://|file|/cn_windows_7_ultimate_with_sp1_x86_dvd_618763.iso|265187737 ...
- 51Nod:完美字符串
约翰认为字符串的完美度等于它里面所有字母的完美度之和.每个字母的完美度可以由你来分配,不同字母的完美度不同,分别对应一个1-26之间的整数. 约翰不在乎字母大小写.(也就是说字母F和f)的完美度相同. ...