【发布时间】:2015-10-04 21:47:28
【问题描述】:
我目前正在尝试学习使用 qmake 为 VS Community 2015 构建 VS 项目文件的细节。我所遵循的教程是这个:qmake tutorial
教程看起来很简单,qmake 运行我的命令也很好。但是,一旦我启动 hello.vcxproj 文件并尝试编译,VS 告诉我它无法找到合适的 qt 头文件来正确编译。这些是关于我的 .pro 文件和 qmake 命令的详细信息。
// .pro file
CONFIG += qt debug
INCLUDEPATH = "C:\Qt\5.5\mingw492_32\include\QtGui"
HEADERS += hello.h
SOURCES += hello.cpp
SOURCES += main.cpp
和
// batch commands
set QMAKESPEC=win32-msvc2015
qmake -tp vc hello.pro
pause
以防万一,这也是我的 PATH 的样子。
%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;%SYSTEMROOT%\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Qt\5.5\mingw492_32\bin
我们将不胜感激任何帮助或推动正确方向。
-壳牌
【问题讨论】:
-
您使用的是Qt Visual Studio Add-in吗?否则我不确定您的 Visual Studio 编译器是否运行
qmake并将其链接到 Qt 头文件和库。 -
我不是,我在网上看到 Qt 的 VS Add-in 目前不支持 VS Community 2015,但我读过 (forum.qt.io/topic/56666/… 我仍然可以将 qt 与 VS 2015 一起使用。跨度>
-
我在this 回答中描述了我如何将VS2015 与
Qt一起使用,这可能会有所帮助。
标签: c++ qt visual-studio-2015 qmake