Visual Studio 2019:如何使用平台工具集 v140_xp? [英] Visual Studio 2019: How to use Platform Toolset v140_xp?

查看:565
本文介绍了Visual Studio 2019:如何使用平台工具集 v140_xp?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 Visual Studio 2019 为 Windows XP 编译应用程序.为此,我尝试使用平台工具集 v140_xp.它不起作用,出现以下错误信息:

I am trying to compile an application for Windows XP using Visual Studio 2019. For that I tried to use platform toolset v140_xp. It does not work, the following error message appears:

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Platforms\Win32\PlatformToolsets\v140_xp\Toolset.targets(36,5): warning MSB8003: Could not find WindowsSdkDir_71A variable from the registry.  TargetFrameworkVersion or PlatformToolset may be set to an invalid version number.
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(366,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry.  TargetFrameworkVersion or PlatformToolset may be set to an invalid version number.

显然,这些工具正在寻找 Windows SDK v7.1A.从 Microsoft 下载 Windows 7 SDK 不起作用.即使您设法安装它,SDK 也有 7.1 版(没有 A)而不是 7.1A.所以错误仍然存​​在.

Clearly, the tools are looking for the Windows SDK v7.1A. Downloading the Windows 7 SDK from Microsoft does not work. Even if you manage to install it, the SDK has version 7.1 (without the A) and not 7.1A. So the error remains.

我发现 Windows SDK v7.1A 曾经包含在 Visual Studio 2015 中,但我在 Visual Studio 2019 安装程序中找不到它.

I have found out that the Windows SDK v7.1A used to be included with Visual Studio 2015, but I cannot find it anywhere in the Visual Studio 2019 installer.

如何使用 v140_xp 工具集?

How do I use the v140_xp toolset?

重现问题的步骤:

  • 使用桌面 C++ 开发安装 Visual Studio 2019
  • 在 Visual Studio 2019 安装程序中选择MSVC v140 - VS2015 C++ Build tools"
  • 创建一个 C++ 控制台应用程序项目
  • 编辑项目设置
  • 选择 v140_xp 平台工具集
  • 尝试构建项目

推荐答案

在 Visual Studio 2019 安装程序中,Windows SDK 7.1A 隐藏在选项C++ Windows XP Support for VS 2017 (v141) tools [Deprecated]"后面.

In the Visual Studio 2019 Installer, the Windows SDK 7.1A is hidden behind the option "C++ Windows XP Support for VS 2017 (v141) tools [Deprecated]".

将鼠标悬停在该选项上会出现一个工具提示,指出 Windows SDK 7.1 包含在该组件中.

Hovering the mouse over that option a tooltip appears that states that Windows SDK 7.1 is included with that component.

这里描述了整个过程:https://docs.microsoft.com/en-us/cpp/build/configuring-programs-for-windows-xp?view=vs-2019

这篇关于Visual Studio 2019:如何使用平台工具集 v140_xp?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆