【问题标题】:Visual studio (2017) build tools 150Visual Studio (2017) 构建工具 150
【发布时间】:2018-06-07 20:55:35
【问题描述】:

当我尝试编译一些 C++ 代码时出现错误

Code:   
    MSB8020
Description:    
    The build tools for v150 (Platform Toolset = 'v150') cannot be found. 
    To build using the v150 build tools, please install v150 build tools.  
    Alternatively, you may upgrade to the current Visual Studio tools by 
    selecting the Project menu or right-click the solution, and then 
    selecting "Retarget solution".

我无法选择“重定向解决方案”,因为没有。
我打开了 Visual Studio 安装程序,但最新的工具集有 141 个。

如何降级构建工具要求或如何“重新定位解决方案”?

TL;DR

我通过编译Autohotkey_L 遇到了这种情况。通过安装 HyperV 虚拟机并下载 Microsoft 提供的开发机器,我做到了完全干净。它已经包含一个 Visual Studio 2017 社区版。没有比这更干净或更最新的了。

【问题讨论】:

标签: visual-c++ autohotkey


【解决方案1】:

默认情况下,您使用的是带有 141 个工具集的 Visual Studio 2017(您也可以另外安装 v140)。 v150 可能会在未来的版本中提供,这就是为什么您仍然可以在工具集中选择它。

问题是当未选择工具集时,它会尝试为您的 Visual Studio 版本使用最高版本,而不查看是否安装了工具集。由于150还没有,所以不能使用。

为了修复它,右键单击项目(不是解决方案!),您的示例应该有 2 个,转到属性 -> 选择配置 - 所有配置 -> 常规 -> 平台工具集 -> 选择 v141(如您应该默认拥有它)-> 好的。用你有的第二个项目来执行它。

如下所示:

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2019-04-02
    • 2017-09-25
    • 2017-10-18
    • 1970-01-01
    • 2017-10-10
    • 2019-07-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多