What's happening
WindowsSdkDir is an internal Visual Studio variable that is derived from registry keys based on the Platform Toolet project property (in the "Configuration Properties / General" section). For Visual Studio 2012 Toolkit (v110), a registry key, for example:
HKLM\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0 HKCU\SOFTWARE\Microsoft\Microsoft SDKs\Windows\v8.0 HKLM\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.0 HKCU\SOFTWARE\Wow6432Node\Microsoft\Microsoft SDKs\Windows\v8.0
regardless of the keys CurrentVersion and CurrentInstallFolder .
How to build with the Windows 8.1 SDK with Visual Studio 2012
As described in this blog post :
VS 2010/2012 users: You can use the property technique for the Windows 8.1 SDK described in this Visual C ++ Team Blog Post originally for the VS 2010 + Windows 8.0 SDK. For VS 2010, just change part of the paths from "8.0" / "win8" to "8.1" / "winv6.3", but otherwise use all of these instructions. For VS 2012, you can simplify all paths by simply adding 8.1 paths to the existing value for each variable. Updated .props are attached to this blog post. This should only be used for developing Win32 desktop applications.
After making these changes, you should get a properties sheet (which is also provided as an attachment to the same blog ), which for x86 looks like:
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ImportGroup Label="PropertySheets" /> <PropertyGroup Label="UserMacros" /> <PropertyGroup> <ExecutablePath>$(ProgramFiles)\Windows Kits\8.1\bin\x86;$(ExecutablePath)</ExecutablePath> <IncludePath>$(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(IncludePath)</IncludePath> <LibraryPath>$(ProgramFiles)\Windows Kits\8.1\lib\winv6.3\um\x86;$(LibraryPath)</LibraryPath> <ExcludePath>$(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(ExcludePath)</ExcludePath> </PropertyGroup> <ItemDefinitionGroup /> </Project>
And similarly for x64:
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ImportGroup Label="PropertySheets" /> <PropertyGroup Label="UserMacros" /> <PropertyGroup> <ExecutablePath>$(ProgramFiles)\Windows Kits\8.1\bin\x64;$(ExecutablePath)</ExecutablePath> <IncludePath>$(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(IncludePath)</IncludePath> <LibraryPath>$(ProgramFiles)\Windows Kits\8.1\lib\winv6.3\um\x64;$(LibraryPath)</LibraryPath> <ExcludePath>$(ProgramFiles)\Windows Kits\8.1\Include\um;$(ProgramFiles)\Windows Kits\8.1\Include\shared;$(ProgramFiles)\Windows Kits\8.1\Include\winrt;$(ExcludePath)</ExcludePath> </PropertyGroup> <ItemDefinitionGroup /> </Project>
A word of caution. Although this would determine all the paths needed to build against the Windows 8.1 SDK, it does not modify WindowSdkDir and related macros that still point to the Windows 8.0 SDK. This can potentially lead to build inconsistencies if you use these macros to determine project properties.
Finally, note that Visual Studio 2013 ships with the Windows 8.1 SDK, and therefore it is an SDK used with the standard tooling feature of the Visual Studio 2013 platform (v120). Therefore, if upgrading to VS2013 is an option, this can save you some trouble.