无法使用 Qt 打开包含文件:"No such file or directory"

Cannot open include file with Qt: "No such file or directory"

我是 C++ 和编程的新手,正在尝试使用 Qt/Qt Creator 进行一个小项目。

我使用的是 MinGW 编译器,但特别是对于这个项目,我需要使用 MSVC 编译器(因为我需要 QtWebEngineWidgets)。

我有 Qt 5.8,我正在使用 Qt Creator。我下载了 Microsoft Visual Studio 2015 (Community),还从 Microsft 的网站上安装了 wdk 和 winsdk 2015(1703 版本),并配置了我的工具包。花了点时间!

不幸的是,当我尝试 运行 我的程序时出现错误:看起来不可能包含 QtWidgets 或 QtWebEngineWidgets。

当我更改项目的工具包(从 MinGW 到 MSVC 2015)时,我尝试 运行 它但我遇到了另一个错误:

Error from the original project

我想通过创建一个新的 Qt 空项目来避免它,我只是 copied/pasted 源代码。现在它看起来好多了,但是如您所见,我无法包含 QtWebEngineWidgets 和 QtWidgets。

Here is the C1083 error

This is what the compiler says

注意:在我添加 #include <QApplication> and #include <QPushButton> 之后,他对 QApplication 做了同样的事情,但没有说任何关于 QPushButton 的事情。

知道发生了什么事吗?

非常感谢

右键单击 visual studio 上的项目 -> 单击属性(在底部) -> 转到 C/C++ -> 所有选项 -> 找到其他包含目录并添加路径到您的 QT 包含文件夹。