【发布时间】:2017-06-14 18:58:52
【问题描述】:
我有一个只存在于 Visual Studio 2017 中的项目。它是一个 C++ dll,到目前为止,我在 Visual Studio GUI 中构建它没有任何问题。但是现在我正在尝试设置自动化,它将在命令行上构建项目并将输出文件上传到所需的位置。这是我迄今为止尝试过的(在全新的命令提示符中):
cd C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC>
vcvarsall amd64
cd C:\Users\me\development\MyProject
msbuild MyProject.slnl (or msbuild MyProject\MyProject.vcxproj)
这给了我错误输出
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\v140\Microsoft.Cpp.Platform.targets(57,5):
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. Alternatively, you
may upgrade to the current Visual Studio tools by selecting the Project menu or right-cli
ck the solution, and then selecting "Retarget solution".
[C:\Users\dev\development\MetaReme\MetaReme\MetaReme.vcxproj]
让我重申一下,我已经在 Visual Studio 2017 中成功构建了针对 v141 工具集的内容,只是在命令行上我遇到了问题。在我的 Visual Studio 安装程序应用程序中,我检查了 VC++ 2017 v141 工具集。我查看了文件系统,在C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\ 中没有v141 文件夹。
谢谢!
【问题讨论】:
-
当您从 IDE 构建时,您确定要为
amd64配置构建吗? -
"Microsoft Visual Studio 14.0" is vs 2015,你确定你使用的是正确版本的开发者命令提示符吗?
标签: c++ command-line msbuild visual-studio-2017