Coffeehouse Thread

11 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Visual Studio 2008 Professional - no windows.h ?

Back to Forum: Coffeehouse
  • User profile image
    W3bbo

    I installed VS2008 Professional with everything checked off, but with the default environment settings for "Visual C# Developer" (so "C++ Projects" appear under a sub-node on the New Project list rather than at the top).

    Thing is, when I try to build a project created by the Win32 application wizard, with zero modifications I get this fatal error:


    Error    1    fatal error C1083: Cannot open include file: 'windows.h': No such file or directory    d:\users\david\my documents\visual studio projects\foo\foo\stdafx.h    12    foo

    Smooth.

    I've read that the Platform SDK (now known as the "Windows SDK") is actually distributed with Visual Studio 2008.

    ...yet it isn't installed anywhere under %programfiles%\Microsoft Visual Studio 2008\

    Fortunately I have the file from VS2005, but does anyone know where it is?

    EDIT: Sorry, I meant to post this to Tech Off

  • User profile image
    ZippyV

    I don't think you need to have the sdk installed to have windows.h. Are you sure you used < > ?
    Anyway, the SDK is installed in a folder called Microsoft SDK in the program files. There you will find a folder with the version of the sdk installed (6.0a). There is already a newer Platform SDK out if you want to be up to date.

    Edit: this is my path on Win 2k8 x64:
    "E:\Program Files\Microsoft SDKs\Windows\v6.0A"

  • User profile image
    Sven Groot

    It works here. Are you sure you didn't deselect something when installing VS2008?

  • User profile image
    sushovande

    Are you on x64 and then deselected the x64 tools during installation by any chance?

  • User profile image
    Dr Herbie

    OK, from my rusty memories on C++ (been C# for so long now ...):

    Have you checked your project settings for additional search paths?  If you search your c: drive for the windows.h file you'll probably find it somewhere like c:\program files\Microsoft Visual Studio XX\VC\PlatformSDK\Include.  Adding that path to the directory list will make the compiler look there for it.

    If it's not even present on the PC, you'll have to grab the platform SDK and install it and then ensure that your project settings include the install path.

    Herbie

  • User profile image
    KarinM

    Dr Herbie said:
    OK, from my rusty memories on C++ (been C# for so long now ...):

    Have you checked your project settings for additional search paths?  If you search your c: drive for the windows.h file you'll probably find it somewhere like c:\program files\Microsoft Visual Studio XX\VC\PlatformSDK\Include.  Adding that path to the directory list will make the compiler look there for it.

    If it's not even present on the PC, you'll have to grab the platform SDK and install it and then ensure that your project settings include the install path.

    Herbie

    As ZippyV mentioned above, the Windows SDK components that install with Visual Studio are installed to a different path than much of the other Visual Studio content. This is to support side-by-side installations of more than one SDK.  By default, the SDK content is installed to Program Files\Microsoft SDKs\Windows\v6.0A and you'll find Windows.h in the include path. 

    The Visual Studio C++ settings are already set to include the Windows SDK content.  If you've overwritten those settings you can reset them or run Repair of VS.

    You can always find the latest Windows SDK (previously known as the PSDK or Platform SDK) on the Windows SDK MSDN Developer Center http://msdn.microsoft.com/en-us/windowsserver/bb980924.aspx.

    Karin
    Windows SDK Team

  • User profile image
    blowdart

    KarinM said:
    Dr Herbie said:
    *snip*

    As ZippyV mentioned above, the Windows SDK components that install with Visual Studio are installed to a different path than much of the other Visual Studio content. This is to support side-by-side installations of more than one SDK.  By default, the SDK content is installed to Program Files\Microsoft SDKs\Windows\v6.0A and you'll find Windows.h in the include path. 

    The Visual Studio C++ settings are already set to include the Windows SDK content.  If you've overwritten those settings you can reset them or run Repair of VS.

    You can always find the latest Windows SDK (previously known as the PSDK or Platform SDK) on the Windows SDK MSDN Developer Center http://msdn.microsoft.com/en-us/windowsserver/bb980924.aspx.

    Karin
    Windows SDK Team

    And side by side is such a pain you realise? Can we *please* have the option of replacing an existing install? Preferably via windows update. I never see that; so I end up with multiple SDKs. Of course I could be doing it wrong Big Smile

  • User profile image
    W3bbo

    Situation resolved. Chris Hubbard, an SDET from the Windows SDK team, emailed me explaining this is actually caused by a bug in the VS2008 Professional installer where selecting everything doesn't actually install the Platform SDK.


    By Chris Hubbard

    The likely solution is to Repair your VS install so the WinSDK components get installed. Normal repair will only repair the components installed, which doesn't seem to currently [install the] WinSDK components. What you will need to do is run setup once again. Choose Add/Remove components. Either select a new component and choose next OR select a component and then deselect it and select Next. Either way should activate the Next button, which is what you need.


    And that solved it.

  • User profile image
    W3bbo

    W3bbo said:
    Situation resolved. Chris Hubbard, an SDET from the Windows SDK team, emailed me explaining this is actually caused by a bug in the VS2008 Professional installer where selecting everything doesn't actually install the Platform SDK.


    By Chris Hubbard

    The likely solution is to Repair your VS install so the WinSDK components get installed. Normal repair will only repair the components installed, which doesn't seem to currently [install the] WinSDK components. What you will need to do is run setup once again. Choose Add/Remove components. Either select a new component and choose next OR select a component and then deselect it and select Next. Either way should activate the Next button, which is what you need.


    And that solved it.
    The plot thickens. Apparently the issue occurs randomly and nothing about it is written to the installation logs, so the only way of knowing if the SDK installed okay is if the files are under %programfiles%\Microsoft SDKs or not.

  • User profile image
    figuerres

    W3bbo said:
    W3bbo said:
    *snip*
    The plot thickens. Apparently the issue occurs randomly and nothing about it is written to the installation logs, so the only way of knowing if the SDK installed okay is if the files are under %programfiles%\Microsoft SDKs or not.
    how bout this:  building my cab file for a ce / smart device project sometimes tryies to include the cf 3.5 framework dll's and other times can't find any of the dll's for the build.

    so I have to nuke and re-import the project outputs at least once a week.

    some kind of bug about the path causes the second bug.

    not sure why it wants to add the .net runtime files but it may be the fault of a 3rd party dll that may be referencing the 2.0 runtime.

  • User profile image
    stevo_

    figuerres said:
    W3bbo said:
    *snip*
    how bout this:  building my cab file for a ce / smart device project sometimes tryies to include the cf 3.5 framework dll's and other times can't find any of the dll's for the build.

    so I have to nuke and re-import the project outputs at least once a week.

    some kind of bug about the path causes the second bug.

    not sure why it wants to add the .net runtime files but it may be the fault of a 3rd party dll that may be referencing the 2.0 runtime.
    Today I managed to crash the c# compiler.. I was proud, but no doubt you guys will tell me its really easy to do.. it said something along the lines of..

    Yadda yadda, the likely culprit is 'EMIT'.

    Assuming its talking about code emit.. mm

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.