QtCreator:“无法打开包含文件:'windows.h'”

问题描述 投票:0回答:2

我是 Qt 的新手,所以我决定从运行一些教程(来自 QtCreator)开始。 我想编译教程 2“使用 Qt Quick 组件创建 Qt Quick 应用程序”中的项目,但以以下错误消息结束:

D:\Software\QtSDK\QtCreator\bin\jom.exe -nologo -j 8 -f Makefile.Release
  cl -c -nologo -Zm200 -Zc:wchar_t- -O2 -MD -GR -EHsc -W3 -w34100 -w34189 -DUNICODE -DWIN32 -DQT_LARGEFILE_SUPPORT -DQ_COMPONENTS_SYMBIAN -DHAVE_MOBILITY -DQT_DLL -DQT_NO_DEBUG -DQT_DECLARATIVE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_3DNOW -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -DQT_THREAD_SUPPORT -I"..\..\..\Software\QtSDK\Simulator\Qt\msvc2008\include\QtCore" -I"..\..\..\Software\QtSDK\Simulator\Qt\msvc2008\include\QtNetwork" -I"..\..\..\Software\QtSDK\Simulator\Qt\msvc2008\include\QtGui" -I"..\..\..\Software\QtSDK\Simulator\Qt\msvc2008\include\QtDeclarative" -I"..\..\..\Software\QtSDK\Simulator\Qt\msvc2008\include" -I"..\..\..\Software\QtSDK\Simulator\QtMobility\msvc2008\include\QtSystemInfo" -I"d:\Software\QtSDK\Simulator\QtMobility\msvc2008\include\QtMobilitySimulator" -I"..\Tut1\qmlapplicationviewer" -I"..\..\..\Software\QtSDK\Simulator\QtMobility\msvc2008\include" -I"..\..\..\Software\QtSDK\Simulator\QtMobility\msvc2008\include\QtMobility" -I"..\..\..\Software\QtSDK\Simulator\Qt\msvc2008\include\ActiveQt" -I"release" -I"..\Tut1" -I"." -I"..\..\..\Software\QtSDK\Simulator\Qt\msvc2008\mkspecs\win32-msvc2008" -Forelease\ @C:\Users\113010~1\AppData\Local\Temp\qmlapplicationviewer.obj.2328.0.jom
 qmlapplicationviewer.cpp
 d:\software\qtsdk\simulator\qt\msvc2008\mkspecs\win32-msvc2008\../win32-msvc2005/qplatformdefs.h(67) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
 Copying application data... 
 2 File(s) copied

我有一个 Visual Studio 2008 Professional。 Qt Creator 似乎很好地识别它,所以我认为永远不会出现这样的错误。

我还想将工具集从 Microsoft Visual C++ Compiler 9.0 (x86) 更改为 MinGW(单击“管理”按钮时它也会出现在对话框中),但组合框处于非活动状态。

我不知道该怎么办。

c++ visual-studio-2008 qt-creator
2个回答
0
投票

如果您还没有安装Windows SDK,您可能需要安装


0
投票

在 Qt Creator,Tools--Options,Build&Run,Kits,选择一个 kit 并编辑它的属性,将 Compiler 从“Microsoft Windows SDK ...”更改为“Microsoft Visual C++ Compiler 9.0 (x86)”。

© www.soinside.com 2019 - 2024. All rights reserved.