locked
Fatal error C1083: Cannot open include file: 'windows.h': No such file or directory

    Question

  • When I try to compile a win32 sample program, I get the
    'fatal error C1083: Cannot open include file: 'windows.h': No such file or directory' error.

    I have installed and configured (even the step not in video) the most recent Platform SDK, but I still get this error!

    What is happening?

    Thanks!
    Tuesday, July 25, 2006 7:29 PM

Answers

  • The instructions on downloading and installing the Platform SDK are specifically written to let you use windows.h.  You messed up somewhere but won't give us any hints how.  There have been complaints, perhaps it is intentionally made difficult...

    Tuesday, July 25, 2006 10:20 PM
    Moderator

All replies

  • The video has an issue in step3. Look at the instructions at http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/ and specifically step 3 to set the include path.

    Hope this helps!

    Thanks,
    Ayman Shoukry
    VC++ Team
    Tuesday, July 25, 2006 7:33 PM
  • I have tried this before, but I does not help, but thanks.

    Tuesday, July 25, 2006 8:00 PM
  • What is in your include path?

    Thanks,
    Ayman Shoukry
    VC++ Team
    Tuesday, July 25, 2006 8:44 PM
  • I get the same error, not with the Console Application but with the Windows Application.

    It appears that the Console Application part is working allright. Can anybody provide a solution to this?

    Regards

    Modeller

    Tuesday, July 25, 2006 8:48 PM
  • The instructions on downloading and installing the Platform SDK are specifically written to let you use windows.h.  You messed up somewhere but won't give us any hints how.  There have been complaints, perhaps it is intentionally made difficult...

    Tuesday, July 25, 2006 10:20 PM
    Moderator
  • yeah i'm having the same problem.

    I tried the standard paths etc in the options and they didnt work so then i tried to use an absolute such as:

    $(C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib)

    $(C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include)

    Here is my VCProjectEngine.dll.express config file

    <Directories
       Include="$(VCInstallDir)include;$(VCInstallDir)PlatformSDK\include;$(FrameworkSDKDir)include"
       Library="$(VCInstallDir)lib;$(VCInstallDir)PlatformSDK\lib;$(FrameworkSDKDir)lib;$(VSInstallDir);$(VSInstallDir)lib"
       Path="$(VCInstallDir)bin;$(VCInstallDir)PlatformSDK\bin;$(VSInstallDir)Common7\Tools\bin;$(VSInstallDir)Common7\tools;$(VSInstallDir)Common7\ide;$(ProgramFiles)\HTML Help Workshop;$(FrameworkSDKDir)bin;$(FrameworkDir)$(FrameworkVersion);$(VSInstallDir);$(PATH)"
       Reference="$(FrameworkDir)$(FrameworkVersion)"
       Source="$(VCInstallDir)crt\src"

    And they arnt working either. I'm going to try everything again but would love any hints or tips anyone has.

    with regards

    Wednesday, July 26, 2006 1:59 AM
  • AHA!

    I've realised my mistake and now its working perfectly.

     

    Cheers

    Wednesday, July 26, 2006 2:28 AM
  • What do you mean by this post? The instructions on how to install the PSDK are given in the link you gave. Those are the instructions I followed. I do not have any explanation why the console application is working and the windows application is not. If I messed up somewhere please check the instructions you are reffering to, maybe these instructions are messy!

    Modeller

    Wednesday, July 26, 2006 7:52 AM
  • Could you please post your include path?

    Thanks,
    Ayman Shoukry
    VC++ Team
    Wednesday, July 26, 2006 5:22 PM
  • C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include

    Regards'Modeller

    Wednesday, July 26, 2006 7:31 PM
  • How did you include this directory via the IDE? What is there now in your include settings of the IDE?

    Thanks,
    Ayman Shoukry
    VC++ Team
    Wednesday, July 26, 2006 8:49 PM
  • Sorry about that. I should have given the full path, but it was very obvious to me! Well :

    This is the complete include setting of the IDE:

    C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include
    C:\Program Files\Microsoft DirectX SDK (June 2006)\Include
    C:\Program Files\Microsoft DirectX 9.0 SDK (October 2005)\Include
    $(VCInstallDir)include
    $(VCInstallDir)PlatformSDK\include\prerelease
    $(VCInstallDir)PlatformSDK\include
    $(FrameworkSDKDir)include

    I hope I understood your question correct. I generated the path by clicking on the PSDK's path generator and I did not change any option for the installation. Everything is directed to the associated default folders.

    Regards

    Modeller

    Thursday, July 27, 2006 9:36 AM
  • Sorry for the late reply.

    My install directory is: C:\Program Files\Microsoft Platform SDK

    These are the include setting of the IDE:

    $(VCInstallDir)include
    $(VCInstallDir)PlatformSDK\include
    $(FrameworkSDKDir)include

    I hope this helps.

    Thursday, July 27, 2006 12:05 PM
  • Looks like you skipped step #3 in the installation instructions...
    Thursday, July 27, 2006 12:21 PM
    Moderator
  • I have tried doing that, but it said the path does not exist, so I reverted it back to how it was.
    Thursday, July 27, 2006 12:34 PM
  • I have found out what to do!

    Instead of putting:
    $(VCInstallDir)include
    etc
    I put:

    C:\Program Files\Microsoft Platform SDK\Include
    and it worked!



    Thursday, July 27, 2006 12:42 PM
  • Hi Griffith

    I am new to the VCC+ and MFC application.  .......I have the same error that u had and i tried to install and configure the same way u did

    first by $c://ProgramFiles/miro........

    it dint work ...i dont know wats .dll and how u change it .

    cud u help me with this issue......

     

    Saturday, November 11, 2006 11:18 PM
  • I am completely new to the MS development tool world and ran into the same problem.  I think that it may be due to lack of clarity in the version of the instructions I was following (http://msdn.microsoft.com/vstudio/express/visualc/usingpsdk/).  My solution was to change the "Show directories for:" drop-down, as follows:

    Tools | Options
    then, under Projects and Solutions | VC++ (in the left pane),
    with Platform set to "Win32"
    With the "Show directories for:" drop-down set at, "Executable files" I added the "bin" path (C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Bin)

    then

    CHANGE the "Show directories for" drop-down to:
    "Include files" and add the "Include" path to the include files (default was "C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include")

    then

    CHANGE the "Show directories for" drop-down to:
    "Library files" and add the "Lib" path to the include files (default was "C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Lib")

    Success.
    P.S.  For other newbies:  I didn't use the "$"at the beginning of those path entries and don't know if they are needed for anything.  I figured they were for variables and I was entering a full path--and it worked--but if enlightment or clue are available here...
    P.P.S.  If anyone went through those same instructions and knows what the other lines in the AppSettings.htm file, for WIN_APP.disabled, DLL_APP.disabled, DLL_APP_LABEL.disabled (in addition to lines 441-444) do I'm curious.  They are under a "JScript" section, as I recall.

    Thursday, November 30, 2006 1:12 PM
  • i have an error installing the 3 package set on instilation set number 2. it said my link all the way to My Documents >>>"...\My Documents\vspfix\PSDK-amd64.exe is not valid Win32 application." with only the option of pressing "OK". This does not make sense to me, but I will keep my hopes up that maybee one of you can give feed back on what this error might mean. Please help!!!
    Friday, February 23, 2007 6:32 PM
  • I am having the same problem and these links have gone sour.  The guides I've gotten related to this problem are also no good because the current "Windows Platform SDK" doesn't install with the same directory structure, so I'm a little confused.
    Sunday, October 26, 2008 6:26 AM
  • This link takes you to a marketing page about Visual Studio, not instructions on setting include paths.
    Tuesday, May 19, 2009 2:57 PM
  • And your mistake was???  It's rude to announce you've found a solution and not share it.
    Tuesday, May 19, 2009 2:59 PM