I get the following error when I try to build my Visual Studio C project:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.Cpp.Platform.targets(55,5): error MSB8020: The build tools for Visual Studio 2010 (Platform Toolset = 'v100') cannot be found. To build using the v100 build tools, please install Visual Studio 2010 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". [C:\path\to\src\li.vcxproj]
However, I only have v140 in my project:
$ grep -hrIi platformtoolset .
#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1
#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1
#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1
#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1
#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1
#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1
#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1
#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1
#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1
#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v140</PlatformToolset>
#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1
#TargetFrameworkVersion=v4.0:PlatformToolSet=v140:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native32Bit:WindowsTargetPlatformVersion=8.1
#TargetFrameworkVersion=v4.0:PlatformToolSet=v140_xp:EnableManagedIncrementalBuild=false:VCToolArchitecture=Native64Bit:WindowsTargetPlatformVersion=
I tried retargeting the solution as suggested in the error message, but I didn't see any option for v140 in the dropdown:
I cannot upgrade to v141, because my team's CI builds run on Visual Studio 2015, and I believe Visual Studio 2015 does not have v141.
Why could I be getting this error, and how can I fix it?
CodePudding user response:
v140 build tools can be downloaded in VS installer.
And I see in your error message that you need v100 build tools, you could refer to this link for the download method.
CodePudding user response:
It turns out the problem was that I only made the settings changes for one of the projects in the solution, and I failed to make the settings changes to the entire solution. The platform toolset error message was just a red herring.