简体   繁体   English

找不到 Visual Studio Platform 2015 工具集 ='v141'

[英]Visual Studio Platform 2015 Toolset ='v141' cannot be found

I'm trying to compile a project using OpenFrameworks (a library which uses C++) in Visual Studio.我正在尝试在 Visual Studio 中使用 OpenFrameworks(一个使用 C++ 的库)编译一个项目。 The build is set to Release and X64 and in the project properties I have set the Platform Toolset to Visual Studio 2015 (v140)构建设置为 Release 和 X64,在项目属性中,我将平台工具集设置为 Visual Studio 2015 (v140)

However every time I try to build the project I get the same error (amongst others)但是,每次我尝试构建项目时,都会遇到相同的错误(等等)

Error MSB8020 The build tools for v141 (Platform Toolset = 'v141') cannot be found.错误 MSB8020 找不到 v141 的构建工具(平台工具集 = 'v141')。 To build using the v141 build tools, please install v141 build tools.要使用 v141 构建工具进行构建,请安装 v141 构建工具。

I know v141 is from the new version of MSVS 2017 but I do not want to upgrade to as the new version is not compatible with OpenFrameworks.我知道 v141 来自 MSVS 2017 的新版本,但我不想升级到新版本,因为新版本与 OpenFrameworks 不兼容。 I have tried rebuilding the project from scratch several times and have also looked into the VCXPROJ file and verified that everything is set to V140 - and it is.我曾多次尝试从头开始重建项目,并且还查看了 VCXPROJ 文件并确认所有内容都设置为 V140 - 确实如此。 All very bizarre.一切都非常离奇。

It seems that on build, something is setting a requirement for v141 but I cannot seem to find where this is coming from.似乎在构建时,有些东西为 v141 设置了要求,但我似乎无法找到它的来源。 Does anyone have an idea?有没有人有想法?

I had such an issue.我有这样的问题。 The solution is: open menu "Project"->Properties->Configuration Properites->General - and choose platform toolset v140.解决方法是:打开菜单“项目”->属性->配置属性->常规-选择平台工具集v140。

Had this same error trying to npm install after cloning a node based project.在克隆基于节点的项目后尝试npm install出现同样的错误。 It had an npm dependency that required C++ source to be compiled.它有一个需要编译 C++ 源代码的 npm 依赖项。

I had already modified my VS2017 install to include Individual Components -> VC++ 2017 version 15.7 v14.14 latest v141 tools我已经修改了我的VS2017安装以包含Individual Components -> VC++ 2017 version 15.7 v14.14 latest v141 tools

but that didn't help.但这没有帮助。

I applied these commands in succession我连续应用了这些命令

  1. npm install -g node-gyp

  2. npm install --global --production windows-build-tools

The first had no effect but the second did the trick and the npm install command completed successfully after that.第一个没有效果,但第二个成功了,之后npm install命令成功完成。

This was addressed in the comments of one of the answers, but it worked for me.这在其中一个答案的评论中得到了解决,但它对我有用。 I had both v140 and v141 build tools installed, so when I had to use v140 build tools for something, I set the VCTargetsPath variable to the path of the v140 build tools.我同时安装了 v140 和 v141 构建工具,因此当我不得不使用 v140 构建工具进行某些操作时,我将VCTargetsPath变量设置为 v140 构建工具的路径。 Deleting this variable in my environment variables ultimately fixed this issue for me.在我的环境变量中删除这个变量最终为我解决了这个问题。

在此处输入图片说明

For this error, and similar, for other platforms (eg VS2013) this problem typically occurs because you installed an older version of VS after you installed a later one.对于此错误,以及类似的,对于其他平台(例如 VS2013),此问题通常是因为您在安装较新版本后安装了较旧版本的 VS。 It's my observation that this will effect all of your Visual Studio C++ projects, and you will have to manually set them to target the specific toolset for the given version of VS you are trying to build the project under.根据我的观察,这将影响您的所有 Visual Studio C++ 项目,您必须手动设置它们以针对您尝试在其下构建项目的给定 VS 版本的特定工具集。

在此处输入图片说明

If anyone has the same issue.. Reason: When someone tries to open existing solution which created/build on latest VS version (VS2015 / 2017) and tried to open with backward / old version of VS instance.如果有人遇到同样的问题。 原因:当有人尝试打开在最新 VS 版本(VS2015 / 2017)上创建/构建的现有解决方案并尝试使用向后/旧版本的 VS 实例打开时。 Then this error might occur.那么可能会出现这个错误。

Please try below steps.请尝试以下步骤。 Right click Project->Properties->Configuration Properties.右键单击项目->属性->配置属性。 Set 'Target Platform Version' as Supported OS version, ie for 8.1 > Win7 & 10 Win10 Set 'Platform tool set' as installed visual studio version.将“目标平台版本”设置为支持的操作系统版本,即对于 8.1 > Win7 & 10 Win10 将“平台工具集”设置为已安装的 Visual Studio 版本。

Re-Build & Enjoy :)重新构建和享受:)

I had that v141 error when building from command-line but not inside visual studio:从命令行构建时出现 v141 错误,但在 Visual Studio 中没有:

The build tools for v141 (Platform Toolset = 'v141') cannot be found.找不到 v141 的构建工具(平台工具集 = 'v141')。 To build using the v141 build tools, please install v141 build tools.要使用 v141 构建工具进行构建,请安装 v141 构建工具。 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 工具。

Turns out it was because I was calling the wrong vcvars so I was using the wrong version of msbuild.exe:原来是因为我调用了错误的 vcvars,所以我使用了错误版本的 msbuild.exe:

:: wrong (Visual Studio 2015)
call "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x64 >NUL
:: correct (Visual Studio 2017)
call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\VC\Auxiliary\Build\vcvars64.bat" x64 >NUL

Not sure it's possible for this to be the error inside visual studio, but I hope this is helpful to some future searcher...不知道有可能为这是在Visual Studio的错误,但我希望这是有帮助的一些未来的搜索...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 2017:找不到 v142 的构建工具错误,即使平台工具集设置为 v141 - Visual Studio 2017: build tools for v142 cannot be found error, even though Platform Toolset is set to v141 找不到 v141 (Platform Toolset = 'v141') 的构建工具 - The build tools for v141 (Platform Toolset = 'v141') cannot be found NPM安装:找不到平台工具集= v141 - NPM install: Platform Toolset = v141 cannot be found 构建在 VS 2013 中找不到 Platform Toolset = 'v141' - build cannot find Platform Toolset = 'v141' in VS 2013 尝试安装 npm 模块 scrypt 时出现“错误 MSB8020:找不到 v141 的构建工具(平台工具集 = 'v141')” - "error MSB8020: The build tools for v141 (Platform Toolset = 'v141') cannot be found" when trying to install npm module scrypt 找不到Visual Studio 2008的生成工具(Platform Toolset ='v90') - The build tools for Visual Studio 2008 (Platform Toolset = 'v90') cannot be found 在Visual Studio 2015中使用v90(VS2008)平台工具集 - Using v90 (VS2008) Platform Toolset in Visual Studio 2015 (Visual C ++ v141)按位函数编译错误 - (Visual C++ v141) Bitwise function compiling incorrectly 无法在Visual Studio 2015 Update 1 CMake中将工具集设置为新的v140_clang_3_7 - Cannot set toolset to the new v140_clang_3_7 in Visual Studio 2015 Update 1 CMake 使用平台工具集v100的Visual Studio 2012。 无法打开源文件“ atlbase.h” - Visual Studio 2012 using platform toolset v100. Cannot open source file “atlbase.h”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM