DNamto
DNamto

Reputation: 1362

Qt Creator issue : Cannot open include file: ‘windows.h’

I have installed ‘Qt Creator 2.4.1 Based on Qt 4.7.4 (32 bit)’ on Windows 7 with Visual studio 2008. But on creating the basic project am getting following error :

 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

Also I checked the windows.h its present in following location : C:\Program Files\Microsoft SDKs\Windows\v7.0A\Include\

I would like to mention that I can’t use the MinGW target due to project specifications.

Requesting everyone to help me out of this situation.

Upvotes: 0

Views: 10194

Answers (2)

cspark
cspark

Reputation: 1

Check Qt creator's Projects/Build Environment and edit variables

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

that contains Windows SDK 7.1 path(C:\Program Files **(x86)\Microsoft SDKs\Windows\v7.1**).

Maybe Windows SDK 7.1 is installed at "C:\Program Files\Microsoft SDKs\Windows\v7.1"

Upvotes: 0

Brent81
Brent81

Reputation: 1172

in Qt Creator, Tools--Options, Build&Run, Kits, choose a kit and edit its attributes, change the Compiler from "Microsoft Windows SDK ..." to "Microsoft Visual C++ Compiler 9.0 (x86)".

I solved the same problem by this way.

Upvotes: 1

Related Questions