WindowsSDK_IncludePath在哪里定义?

Mar*_*Mao 15 visual-studio visual-studio-2013 visual-studio-2015

宏$(WindowsSDK_IncludePath)具有图片中显示的值.

我想知道这些值的定义在哪里,它们必须在某些文件中定义.

图片来自Visual Studio 2013.

在此输入图像描述

mag*_*981 5

我在文件sdk.props夹中看到了数据C:\Program Files (x86)\Windows Kits\8.0\build\CommonConfiguration\Neutral

<PropertyGroup>
     <WindowsSdkDir Condition="'$(WindowsSdkDir)' == ''">$([MSBUILD]::GetDirectoryNameOfFileAbove('$(MSBUILDTHISFILEDIRECTORY)', 'sdkmanifest.xml'))</WindowsSdkDir>
  </PropertyGroup>

  <PropertyGroup>    <WindowsSDK_IncludePath>$(WindowsSdkDir)Include\um;$(WindowsSdkDir)Include\shared;$(WindowsSdkDir)Include\winrt;</WindowsSDK_IncludePath>
  </PropertyGroup>
Run Code Online (Sandbox Code Playgroud)

我使用的是Win8 + VS2012,因此它应该在VS2013 + 8.1 SDK的文件夹8.1中.

  • 要提供一些信息,8.1的文件位于`C:\ Program Files(x86)\ Windows Kits\8.1\DesignTime\CommonConfiguration\Neutral\Windows.props` (2认同)

Jef*_*Son 5

对我来说,它是文件Microsoft.Cpp.Common.props夹中的文件C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140,我必须将硬编码的 Windows 10 SDK 版本从 10.0.10240.0 更改为 10.0.10586.0。

<!-- 10.0.10240.0 is the hardcoded checked-in version of uCRT that we use in case we target 8.1 SDK -->
<TargetUniversalCRTVersion Condition="'$(TargetUniversalCRTVersion)' == ''  and ('$(TargetPlatformVersion)' == '8.1' or '$(DefineWindowsSDK_71A)' == 'true')">10.0.10586.0</TargetUniversalCRTVersion>
Run Code Online (Sandbox Code Playgroud)

我在 Windows 10 上使用 VS2015,但由于缺少包含文件而无法针对 Windows 8.1 SDK 进行编译。安装独立的 Windows 10 SDK 也没有帮助(因为它不包含 10.0.10240 的 ucrt 文件,如 ctype.h aso)。


小智 5

就我而言,该WindowsSDK_IncludePath变量已正确定义,并且实际上在Visual Studio 2013中运行良好。因此,我什至卸载并重新安装了VS2015。然后,我发现通过此链接,可以通过特定的用户设置来修改预设的宏变量。这些用户设置存储在C:\Users\<user>\AppData\Local\Microsoft\MSBuild\v4.0\Microsoft.Cpp.Win32.user.props我的情况下如下:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ImportGroup Label="PropertySheets">
  </ImportGroup>
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup>
    <IncludePath>$(VC_IncludePath);$(WindowsSDK_IncludePath);C:\Program Files (x86)\CodeSynthesis XSD 4.0\include;</IncludePath>
    <LibraryPath>$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86);C:\Program Files (x86)\CodeSynthesis XSD 4.0\lib\vc-12.0;</LibraryPath>
    <ExecutablePath>C:\Program Files (x86)\CodeSynthesis XSD 4.0\bin;$(VC_ExecutablePath_x86);$(WindowsSDK_ExecutablePath);$(VS_ExecutablePath);$(MSBuild_ExecutablePath);$(SystemRoot)\SysWow64;$(FxCopDir);$(PATH);</ExecutablePath>
  </PropertyGroup>
  <ItemDefinitionGroup />
  <ItemGroup />
</Project>
Run Code Online (Sandbox Code Playgroud)

<IncludePath>句话使VS2015无法找到正确的值。在一切正常工作的便携式计算机中,文件基本上为空:

<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <ImportGroup Label="PropertySheets">
  </ImportGroup>
  <PropertyGroup Label="UserMacros" />
  <PropertyGroup>
  </PropertyGroup>
  <ItemDefinitionGroup />
  <ItemGroup />
</Project>
Run Code Online (Sandbox Code Playgroud)

将文件设置好后,一切正常。当然,我失去了CodeSynthesis XSD的执行首选项,但是现在我不从事任何使用它的项目。我将继续尝试使用该文件的不同变体。


小智 5

I find Reason that \xef\xbc\x9a Windows Registry\n
Run Code Online (Sandbox Code Playgroud)\n
[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows Kits\\Installed Roots]\n"KitsRoot10"="C:\\\\Program Files\\\\Windows Kits\\\\10\\\\"\n\nbut in Actually \n"KitsRoot10"="C:\\\\Program Files (x86)\\\\Windows Kits\\\\10\\\\"\n"AppVerifier64BitAutomationRoot"="C:\\\\Program Files\\\\Application Verifier\\\\"\n"KitsRoot81"="C:\\\\Program Files (x86)\\\\Windows Kits\\\\8.1\\\\"\n
Run Code Online (Sandbox Code Playgroud)\n