VS2015とVS2013が並んでいるマシンがあり、VS2013ツールセット(v120)を使用して何かを構築しようとしています。しかし、プロジェクトファイルの明示的な上書きを念頭に置いて、v140を使用しようとしています。ここでMsbuildがVisual C++プロジェクトに指定されたツールセットを使用していません
C:\transfer\MathLib\testSse>msbuild Sse.vcxproj
Microsoft (R) Build Engine version 12.0.40629.0
[Microsoft .NET Framework, version 4.0.30319.42000]
Copyright (C) Microsoft Corporation. All rights reserved.
Build started 23-Mar-17 12:35:07.
Project "C:\transfer\MathLib\testSse\Sse.vcxproj" on node 1 (default targets).
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB8020: The build t
ools for v140 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install v140 bui
ld tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-cli
ck the solution, and then selecting "Upgrade Solution...". [C:\transfer\MathLib\testSse\Sse.vcxproj]
Done Building Project "C:\transfer\MathLib\testSse\Sse.vcxproj" (default targets) -- FAILED.
Build FAILED.
"C:\transfer\MathLib\testSse\Sse.vcxproj" (default target) (1) ->
(PlatformPrepareForBuild target) ->
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.Cpp.Platform.targets(64,5): error MSB8020: The build
tools for v140 (Platform Toolset = 'v140') cannot be found. To build using the v140 build tools, please install v140 b
uild tools. Alternatively, you may upgrade to the current Visual Studio tools by selecting the Project menu or right-c
lick the solution, and then selecting "Upgrade Solution...". [C:\transfer\MathLib\testSse\Sse.vcxpro
j]
0 Warning(s)
1 Error(s)
Time Elapsed 00:00:00.16
C:\transfer\MathLib\testSse>notepad Sse.vcxproj
は、プロジェクトファイルからreleventの抜粋です。
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
<PropertyGroup Label="Configuration" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<PlatformToolset>v120</PlatformToolset>
</PropertyGroup>
私は、このコマンドでこれをオーバーライドすることができます。
msbuild Sse.vcxproj /p:PlatformTooset=v120
そしてそれはコンパイルが、それは本当にありません私は大規模なVisual Studioソリューションでこれらの多くを持っているので、問題を解決し、それらのすべてのパラメータを使用する必要があります。私が解決策にmsbuildオーバーライドパラメータを何らかの形で置くことができない限り。
でも、msbuild
には、私がどこにも言及されていない別のツールセットを使用する原因がありますか?
VS2015
の後にVS2013
をインストールした可能性があります。これは少し珍しいことです。それが問題だろうか?
PlatformToolset v120は、プロジェクトのすべてのプラットフォームと構成に対してインストールされていますか? –
はい、とにかくその1つのプロジェクトです。どこかでグローバルなオーバーライドが必要です。 –
'PlatformToolset'を使わずにプラットフォームと設定を明示的に指定してプロジェクトをビルドしようとするとどうでしょうか? 'msbuild Sse.vcxproj/p:プラットフォーム=リリース/ p:構成= x64' ビルドは成功するでしょうか?今のところ私はプロジェクトが 'PlatfromToolset V140'でビルドされているという印象を受けています。なぜなら、このプラットフォームや設定には' PlatformToolset v140'があるからです。 –