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

    السؤال

  • 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!
    29/جمادى الثانية/1427 07:29 م

الإجابات

  • 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...

    29/جمادى الثانية/1427 10:20 م

جميع الردود

  • 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
    29/جمادى الثانية/1427 07:33 م
  • I have tried this before, but I does not help, but thanks.

    29/جمادى الثانية/1427 08:00 م
  • What is in your include path?

    Thanks,
    Ayman Shoukry
    VC++ Team
    29/جمادى الثانية/1427 08:44 م
  • 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

    29/جمادى الثانية/1427 08:48 م
  • 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...

    29/جمادى الثانية/1427 10:20 م
  • 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

    01/رجب/1427 01:59 ص
  • AHA!

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

     

    Cheers

    01/رجب/1427 02:28 ص
  • 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

    01/رجب/1427 07:52 ص
  • Could you please post your include path?

    Thanks,
    Ayman Shoukry
    VC++ Team
    01/رجب/1427 05:22 م
  • C:\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include

    Regards'Modeller

    01/رجب/1427 07:31 م
  • 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
    01/رجب/1427 08:49 م
  • 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

    02/رجب/1427 09:36 ص
  • 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.

    02/رجب/1427 12:05 م
  • Looks like you skipped step #3 in the installation instructions...
    02/رجب/1427 12:21 م
  • I have tried doing that, but it said the path does not exist, so I reverted it back to how it was.
    02/رجب/1427 12:34 م
  • 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!



    02/رجب/1427 12:42 م
  • 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......

     

    20/شوال/1427 11:18 م
  • 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.

    09/ذو القعدة/1427 01:12 م
  • 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!!!
    05/صفر/1428 06:32 م
  • 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.
    26/شوال/1429 06:26 ص
  • This link takes you to a marketing page about Visual Studio, not instructions on setting include paths.
    24/جمادى الأولى/1430 02:57 م
  • And your mistake was???  It's rude to announce you've found a solution and not share it.
    24/جمادى الأولى/1430 02:59 م