Share via


warning MSB8003: Could not find WindowsSDKDir variable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid version number.

Question

Monday, October 13, 2014 12:58 PM | 1 vote

I have Windows Server 2008 R2 x64 bit. I have a full Visual Studio Premier 2013 edition with Update 3.

When I try to compile my Visual Studio c++ projects, the compiler throws following errors and warnings

1> Build started: Project: PFMLib, Configuration: Release x64
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets(362,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry.  TargetFrameworkVersion or PlatformToolset may be set to an invalid version number.
1>  Barrier_STL_CCS.cpp
1>C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\concrt.h(39): fatal error C1083: Cannot open include file: 'guiddef.h': No such file or directory
1>  Barrier_Win32_Base.cpp
1>e:\github\pfm\pfm\src\Barrier_Win32_Base.h(4): fatal error C1083: Cannot open include file: 'Windows.h': No such file or directory
1>  BHTree.cpp
1>E:\github\pfm\pfm\src\SimulationObjects\structures.h(12): fatal error C1083: Cannot open include file: 'windows.h': No such file or directory

.....

When I installed VS, I installed it fully with all the components. I have tried to check on the internet to resolve the issue and tried repairing my VS installation. Also tried installing Windows SDK 8.1 but it fails. As of now I cant even get a small VC++ test project compiled. Seems to be issue with some configuration.

Any suggestions on how to fix this ?

Varun

All replies (1)

Tuesday, October 14, 2014 5:37 AM ✅Answered

Hi Varun,

Based on the error message, one possible reason is that the TargetFrameworkVersion or PlatformToolset may be set to an invalid version number. Please check the settings in Project Properties - Configuration Properties - General - Platform Toolset and make sure it is set to Visual Studio 2013.

One possible reason is that Visual Studio internal variable WindowsSdkDir is missing from the registry. Please reference this blog: https://helgeklein.com/blog/2010/01/visual-studio-fixing-broken-windowssdkdir-variable/ and Rhfritz’s solution provided in this thread: https://social.msdn.microsoft.com/Forums/vstudio/en-US/853aa155-886b-491c-a414-fa4bca50251a/winsdkverh-no-such-file-or-directory?forum=vcgeneral#e5d73ba3-6a88-4ce7-b5f2-86c0e3a56de6 to fix your $WindowsSdkDir.

We can fix it by setting it with a simple script as CoolOppo said in this thread:

http://stackoverflow.com/questions/22188919/windows-sdk-registry-variable-not-found

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.1]

"CurrentInstallFolder"="C:\Program Files (x86)\Windows Kits\8.1\"

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.