Qt: No such file or directory

来源:互联网 发布:淘宝客返利api 编辑:程序博客网 时间:2024/06/13 02:56

首先说一下,我的构建套件是Desktop Qt5.2.0 MSVC2010 32bit OpenGL,编辑环境是Qt Creator 3.0.0,不知道在其他环境下会不会出现这个问题安静

比如在一个工程中需要添加头文件QGraphicsItem,出现下面的问题:



可以查一下QGraphicsItem在帮助文档的信息,需要在工程文件.pro文件中添加QT += widgets



但你在工程中.pro文件加入greaterThan(QT_MAJOR_VERSION,4):QT+=widgets,还是会出现错误:



这时候你查看生成的build文件夹中Makefile文件就会发现问题,Makefile文件竟然没有添加lib/Qt5Widgets.prl:



你即使点击构建->清理项目,Makefile的内容也不改变,这时候只有把它删除了,然后再编译(感觉这个是个bug啊):


No such file 的错误就消失了。大笑


参考:

【1】也谈Qt经典出错信息之QApplication: No such file or directory http://blog.csdn.net/qter_wd007/article/details/5377131

【2】QT编译出现fatal error: QApplication: No such file or directory http://blog.csdn.net/chenyijun/article/details/12685807


0 0