'winsdkver.h': No such file or directory RRS feed

  • Question

  • Help!!!!!

    1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppBuild.targets(344,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry.  TargetFrameworkVersion or PlatformToolset may be set to an invalid version number.
    1>  stdafx.cpp
    1>c:\program files (x86)\microsoft visual studio 11.0\vc\atlmfc\include\afxv_w32.h(25): fatal error C1083:  'winsdkver.h': No such file or directory

    •  I had no problem with the debug , Please help me !!!

    I Try Microsoft SDK for Windows 7 and NET Framework 4  but I have a problem message  'winsdkver.h': No such file or directory

    Sunday, December 8, 2013 9:35 AM


All replies

  • Run regedit and search for WindowsSDKDir.  I want to know if it exists and the version.

    Your Net Library may need repairs and I would recommend posting at the Visual Studio Setup and installation forum.


    Sunday, December 8, 2013 9:42 AM
  • Hi,

    Welcome to MSDN forum.

    Would you mind tell us: can you find winsdkver.h in your computer? We can find it in the path of Microsoft SDKs v7.1A, v.7.0A or Windows Kits 8.0. If not, please try to install the latest one.

    Microsoft Windows SDK for Windows 7 and .NET Framework 3.5 SP1

    Microsoft Windows SDK for Windows 7 and .NET Framework 4

    Windows Software Development Kit (SDK) for Windows 8

    Best Regards,


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, December 9, 2013 8:42 AM
  • you have to install the Windows SDK (Platform SDK.)

    Christophe Pichaud

    Monday, December 9, 2013 8:52 PM
  • While our old systems continue to build our code just fine, I have this exact problem on a brand new development system we setup:  

    1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppBuild.targets(344,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry.  TargetFrameworkVersion or PlatformToolset may be set to an invalid version number.
     1>  stdafx.cpp
     1>c:\program files (x86)\microsoft visual studio 12.0\vc\atlmfc\include\afxv_w32.h(25): fatal error C1083:  'winsdkver.h': No such file or directory

    We get our solutions from our repository, attempt a build, and get the above error on every compile in the solution.

    The new system has: Win7 x64; VS2013 w/ sp2.

    When I run regedit, I find the entry:

    HKLM\software\wow6432Node\Microsoft\microsoft sdks\windows\currentinstallfolder=c:\program files\Microsoft sdks\windows\v6.0a

    And this entry is both on the systems that work and the new one that doesn't.

    Following guidance I found elsewhere, I went ahead and installed the Win7 SDK v7.1.   I ran WindowsSDKVer.exe and saw the above entry displayed.  Toggling between the SDK Version, even though our code doesn't explicitly use anything from it, made no difference.


    I opened a command prompt and verified that the system environment variable


    is present and matches the registry.  Oddly, on the development system where everything does build, the environment variable points to SDK 8.1.    And that system has VS2008, vs2010, vs2012, and VS2013 installed. The new system where I'm having this issue only has VS2013 installed.  But given that our code doesn't explicitly reference in the SDK, I fail to see the significance of any the SDK setting.

    The only other difference I've found is that when I run a vs2013 Developer Command Prompt on my reference system, the environment variable is present.   But when I run the same command on the new system, I don't see the environment variable defined.   But I don't know whether or not this is significant given that it is present as a system environment variable. 

    Thanks in advance for any insight.



    • Edited by rhfritz Wednesday, October 1, 2014 2:18 PM fix spelling
    Wednesday, October 1, 2014 2:16 PM
  • I solved the problem, but I suspect that this solution might not be valid for versions of Visual Studio earlier than 2010.  It turns out that the existence of WindowsSdkDir registry key is not of particular importance in vs2013.  

    In trying to understand why the $(WindowsSdkDir) was empty in visual studio, I ended up examining this bit of code:

    "C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\Tools\VCVarsQueryRegistry.bat"
    @for /F "tokens=1,2*" %%i in ('reg query "%1\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1" /v "InstallationFolder"') DO (
    	@if "%%i"=="InstallationFolder" (
    		@SET "WindowsSdkDir=%%k"
    @if "%WindowsSdkDir%"=="" exit /B 1
    @exit /B 0

    Note that it is explicitly looking for an installation folder for Windows SDK v8.1.   And if it exists, it is overriding any prior definition of the environment variable.

    On my system which DID work, I had this entry:

    On my target system which did not work, the v8.1 entry was missing.   The VS2013 install was successful.   Perhaps on my working system I had installed VS2013 prior to Sp1.  But I had installed both Sp1 and Sp2 in succession on the target system.  And most importantly, the files were on the target, just the registry entry was missing.   So I exited VS2013 on the target and merged in the following section which I had exported from my working system:

    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1]
    "InstallationFolder"="C:\\Program Files (x86)\\Windows Kits\\8.1\\"
    "ProductName"="Microsoft Windows SDK for Windows 8.1"

    Upon restarting VS2013, the macro was present and the issue was resolved.

    The issue occurred on a second target system as well.   And for yet another unknown reason, the \Windows Kits\8.1 were not complete.   The complete set of variables should have looked like this:

    But the folders referenced above by $(WindowsSDK_IncludePath) were either missing or had fewer files.   I not only had to over-write these files with the ones from the working system, but while $(WindowsSdkDir) was created, $(WindowsSDK_IncludePath) was not.   For that I went into VS2013 Property Manager and manually added these Include and executable paths to the "VC ++ Directories" section of Microsoft.Cpp.Win32.User.   My vs2013 solution has nearly 40 projects in it which work fine on our other development systems, not to mention that they're checked into our repository.  So this was the most expedient way to get these development systems up and running.

    As a final note, I had earlier attempted an install of vs2013.sp3 on the target.  Our development systems are not connected to the internet, and I therefore had to install from the ISO.   The install ran for about 15 minutes before it encountered an unintelligible numeric error and couldn't proceed.   It did try to explain the error by opening up a browser window -- Doesn't Microsoft try to test these "not connected" scenarios?  Regardless, after proceeding with an uninstall of sp3, I was able to bring up vs2013.sp2 only to discover that it had marked my solution and all projects as "Incompatible."   I then had to repair my sp2 installation.

    If you made it this far, congratulations.   I hope this helps someone else.


    • Proposed as answer by rhfritz Thursday, October 2, 2014 8:53 PM
    Thursday, October 2, 2014 8:53 PM
  • Many thanks for the most helpful post I've found on this issue.

    I've been trying with Windows Server 2008 R2 and Visual Studio V2013 Express (Desktop) update 3.  Installation has to be offline.

    Adding the SDK 8.1 registry key (even though C++ is using the 7.1 libs) got rid of the MSB8003 warning and I then resorted to updating ...\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Common.props in order to set the VC++ paths for the linker.

    Sunday, October 19, 2014 11:18 PM
  • I'm glad it helped you.  It was a very frustrating issue that took a few days to work through.  Anyway, if you have time, perhaps you could click the vote button.  Thanks.


    Sunday, October 19, 2014 11:30 PM
  • Could you elaborate on how to set the paths for the linker?
    Wednesday, April 13, 2016 4:48 PM