【问题标题】:Qt Creator issue : Cannot open include file: ‘windows.h’Qt Creator 问题:无法打开包含文件:“windows.h”
【发布时间】:2012-10-29 11:08:32
【问题描述】:

我已经使用 Visual Studio 2008 在 Windows 7 上安装了“基于 Qt 4.7.4(32 位)的 Qt Creator 2.4.1”。但是在创建基本项目时出现以下错误:

 c:\qtsdk\desktop\qt\4.8.1\msvc2008\mkspecs\win32-msvc2008\..\win32-msvc2005\qplatformdefs.h:67: 
error: C1083: Cannot open include file: 'windows.h': No such file or directory

我还检查了以下位置的 windows.h:C:\Program Files\Microsoft SDKs\Windows\v7.0A\Include\

我想提一下,由于项目规范,我不能使用 MinGW 目标。

请求大家帮助我摆脱这种情况。

【问题讨论】:

  • 尝试提供头文件“window.h”的完整路径

标签: qt installation qt-creator


【解决方案1】:

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

我通过这种方式解决了同样的问题。

【讨论】:

    【解决方案2】:

    检查Qt 创建者的项目/构建环境编辑变量

    (INCLUDE, LIB, OSINCLUDES, OSLIBRARIES, PROGRAMFILES, SDKDIR, SDKTOOLS, WINDOWSSDKDIR)
    

    包含 Windows SDK 7.1 路径(C:\Program Files **(x86)\Microsoft SDKs\Windows\v7.1**)。

    可能 Windows SDK 7.1 安装在 "C:\Program Files\Microsoft SDKs\Windows\v7.1"

    【讨论】:

      猜你喜欢
      • 2013-10-09
      • 2014-11-13
      • 1970-01-01
      • 1970-01-01
      • 2010-12-13
      • 2016-11-03
      • 2010-09-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多