Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. "Cannot open include file: windows.h" when compiling example from tutorial.
Forum Updated to NodeBB v4.3 + New Features

"Cannot open include file: windows.h" when compiling example from tutorial.

Scheduled Pinned Locked Moved QML and Qt Quick
5 Posts 3 Posters 14.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kappa
    wrote on 7 Dec 2011, 10:20 last edited by
    #1

    Hi!
    I'm new to Qt, so I decided to start from running some tutorials (from QtCreator).
    I wanted to compile a project from tutorial 2 "Creating a Qt Quick Application Using Qt Quick Components", but ended with the below error message:

    @
    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
    @

    I have no clue how to tell the compiler where to look for windows.h header.

    Thanks for any suggestions.

    1 Reply Last reply
    0
    • D Offline
      D Offline
      danimo
      wrote on 7 Dec 2011, 12:25 last edited by
      #2

      Did you install Visual Studio or Visual Studio Express 2008, or a Windows SDK? Otherwise, you cannot use the MSVC 2008 target. If you want something that works out of the box, use the MinGW target instead.

      You should have received a warning about that in the installer though.

      1 Reply Last reply
      0
      • K Offline
        K Offline
        kappa
        wrote on 8 Dec 2011, 10:12 last edited by
        #3

        Thanks for the answer.

        I have a Professional 2008 and didn't notice any warning during installation. Also Qt Creator seems to recognize it well.
        I wanted to change the tool set from Microsoft Visual C++ Compiler 9.0 (x86) to MinGW (it also appears in the dialog when clicked Manage button), but the combo box is inactive.

        Also sometimes (it probably depends on what example I choose) I encounter linker error: LNK1104: cannot open file 'kernel32.lib' (no such file).

        Don't know what to do.

        1 Reply Last reply
        0
        • K Offline
          K Offline
          kappa
          wrote on 12 Dec 2011, 11:52 last edited by
          #4

          I wanted to do it with Visual Studio, but nothing helped (even reinstalling Windows SDK) :(

          Using MinGW, as you suggested, solved the problem (I had to use SDKMaintenanceTool.exe and add MinGW package to QtSDK installation).

          Thanks!

          1 Reply Last reply
          0
          • A Offline
            A Offline
            allopen
            wrote on 21 Dec 2012, 05:15 last edited by
            #5

            see my reply in http://qt-project.org/forums/viewthread/21485/

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved