win下qt5.1 通过空项目纯源码编写项目时 -- QApplication: No such file or directory 问题的解决方法
2013-08-11 14:57
357 查看
通过空项目,添加cpp的方法编写qt-gui程序时,构建时会出现找不到QApplication头文件的错误,自己找了半天,基本上全是针对linux下的解决方法,后来在/article/1809071.html找到了解决方法,需要在pro文件中添加
QT +=widgets,因为在qt5中所有的组件都是在widgets模块中定义的
//main.cpp //#include<QtGui> #include<QApplication> #include<QLabel> #include<QDialog> int main(int argc,char** argv){ QApplication q(argc,argv); QDialog * dd=new QDialog(); QLabel * label=new QLabel(dd); label->setText("Hello World"); QSize ss(200,200); dd->resize(ss); dd->show(); return q.exec(); }
相关文章推荐
- Qt4项目迁移Qt5项目一问题解决方法:#include <QtGui/QApplication> ---> No such file or directory
- Qt4项目迁移Qt5项目一问题解决方法:#include <QtGui/QApplication> ---> No such file or directory
- QT5.0.1在Windows下 出现QApplication: No such file or directory 问题的解决办法
- 项目文件.NET下编译C++代码时出现fatal error C1083: 无法打开包括文件:“xuhk_JNIHelloWorld.h”: No such file or directory错误的解决方法。
- Linux执行.sh文件,提示No such file or directory的问题的解决方法
- Linux执行.sh文件,提示No such file or directory的问题的解决方法
- QT5.1在Windows下 出现QApplication: No such file or directory 问题的解决办法
- 升级gcc4.8 遇到 fatal error: gnu/stubs-32.h: No such file or directory 问题的解决方法
- ubuntu 64bit “arm-linux-gcc: No such file or directory”问题的解决方法
- /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory问题解决方法
- 在VC空项目里添加自定义的预编译头(或关于:无法打开预编译头文件:“Debug/xxx.pch”: No such file or directory的问题的解决)
- Linux执行.sh文件,提示No such file or directory的问题的解决方法
- Linux执行.sh文件,提示No such file or directory的问题的解决方法
- mininet *** Error: RTNETLINK answers: No such file or directory 问题及解决方法
- Linux执行.sh文件,提示No such file or directory的问题的解决方法
- linux下Qt5出现QApplication: No such file or directory解决方法
- Linux执行.sh文件,提示No such file or directory的问题的解决方法
- QMainWindow: No such file or directory 问题的解决方法
- Qt 5 在Windows下 出现QApplication: No such file or directory 问题的解决办法
- 关于【error=2,No such file or directory】问题的一种起因与解决方法