Qt 5.3. QtWidgets:没有这样的文件或目录#include< QtWidgets> [英] Qt 5.3. QtWidgets: No such file or directory #include <QtWidgets>
问题描述
我想编译Qt示例.我收到错误QtWidgets:没有这样的文件或目录#include
I want to compile Qt example. I get error QtWidgets: No such file or directory #include
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets - does not help
QT += widgets - does not help
INCLUDEPATH += /opt/Qt/5.3/Src/qtbase/include/ - does not help
Qt 5.3. Ubuntu 14.04 x64.
Qt 5.3. Ubuntu 14.04 x64.
推荐答案
您需要仔细检查您是否已完成所有这些步骤:
You need to double check that you completed all these steps:
-
已安装模块
Module installed
greaterThan(QT_MAJOR_VERSION,4):QT + =小部件
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
您重新运行Qt 5 qmake.
You re-run the Qt 5 qmake.
话虽如此,我想提醒您,包括整个模块不是一个好主意,因为它包括所有与小部件相关的东西.尝试将其范围缩小到您真正需要的标题.
Having said that, I would like to remind you that including the whole module is not a good idea as it includes all the widgets related things. Try to narrow it down to the headers that you really need.
这篇关于Qt 5.3. QtWidgets:没有这样的文件或目录#include< QtWidgets>的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!