Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. The build is set to Release and X64 and in the project properties I have set the Platform Toolset to 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. To build using the v141 build tools, please install v141 build tools.

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. 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. 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. Does anyone have an idea?

like image 576
cy_b0rg Avatar asked Apr 09 '17 22:04

cy_b0rg


3 Answers

Had this same error trying to npm install after cloning a node based project. It had an npm dependency that required C++ source to be compiled.

I had already modified my VS2017 install to include 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.

like image 45
fiat Avatar answered Nov 20 '22 12:11

fiat


I had such an issue. The solution is: open menu "Project"->Properties->Configuration Properites->General - and choose platform toolset v140.

like image 57
Alexander Bekman Avatar answered Nov 20 '22 12:11

Alexander Bekman


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. Deleting this variable in my environment variables ultimately fixed this issue for me.

enter image description here

like image 6
Chris Gong Avatar answered Nov 20 '22 14:11

Chris Gong