【发布时间】:2018-08-24 21:42:37
【问题描述】:
VS 在使用 v141 工具集和 Windows 10 SDK 进行编译时工作正常,但在我切换到 v141_xp 工具集和 Windows 7.0 SDK 并点击 Build 时它会中断。
重要提示:v141_xp 工具集曾经在大约半年前工作。当时我已经在这台机器上安装了 2010 年到 2017 年的所有 Visual Studio 软件。然后我决定删除所有这些,除了 2017 年。我不知道在那之后 XP 工具集是否坏了,因为从那以后我没有使用它.
一些默认项目的示例输出:
1>------ Build started: Project: Project1, Configuration: Debug Win32 ------
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Platforms\Win32\PlatformToolsets\v141_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.
1>C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCTargets\Microsoft.CppBuild.targets(375,5): warning MSB8003: Could not find WindowsSDKDir variable from the registry. TargetFrameworkVersion or PlatformToolset may be set to an invalid version number.
1>Project1.cpp
1>LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
1>Done building project "Project1.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
如果我删除 XP 支持,安装程序会通知我将释放 220MB,但如果我选择重新安装它,则说“所需的总空间”为 507KB,这令人怀疑。
此外,每当我选择安装 XP 支持时,都会创建 C:\Program Files (x86)\Microsoft SDKs\Windows\v7.1A,但它仍然为空。
有时,即使安装了 XP 支持,当我加载 XP vcxproj 时,此消息也会打印 2 次:
Project 'Project1' could not be loaded because it's missing install components. To fix this launch Visual Studio installer with the following selections:
Windows XP support for C++
安装缺少的功能不会修复它,甚至无法重新安装整个 VS。
【问题讨论】:
标签: windows visual-studio sdk visual-studio-2017