C++ Microsoft Build Tools 2013 缺少 v120 目录

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/19914828/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-27 23:15:06  来源:igfitidea点击:

Microsoft Build Tools 2013 missing v120 directory

c++msbuildvisual-studio-2013

提问by Richard Anthony Hein

We've installed the Microsoft Build Tools 2013, from http://www.microsoft.com/en-us/download/details.aspx?id=40760, but after installation, there is no C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120 directory created, and so it cannot find required targets files.

我们已经从http://www.microsoft.com/en-us/download/details.aspx?id=40760安装了 Microsoft Build Tools 2013,但安装后,没有 C:\Program Files (x86) \MSBuild\Microsoft.Cpp\v4.0\V120 目录已创建,因此找不到所需的目标文件。

Do we really need to install a version of VS2013 for the required targets/props files to be created?

我们真的需要安装一个版本的 VS2013 来创建所需的目标/道具文件吗?

回答by Richard Anthony Hein

The answer is yes, you need to install VS2013. Then add a new string value named VCTargetsPath12to

答案是肯定的,需要安装VS2013。然后添加一个名为新字符串值VCTargetsPath12,以

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\12.0\11.0

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\12.0\11.0

The value should be:

该值应为:

$([MSBuild]::ValueOrDefault('$(VCTargetsPath12)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V120\'))

You also need to change the

您还需要更改

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\12.0\11.0\VCTargetsPath

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\MSBuild\ToolsVersions\12.0\11.0\VCTargetsPath

value to:

价值:

$([MSBuild]::ValueOrDefault('$(VCTargetsPath)','$(MSBuildExtensionsPath32)\Microsoft.Cpp\v4.0\V120\'))

If you continue to have problems with some projects, open the .vcxproj file and make sure the Project element's ToolsVersion attribute is set to 12.0 instead of 4.0. Do the same for the .vcxproj.filters.

如果某些项目仍然有问题,请打开 .vcxproj 文件并确保 Project 元素的 ToolsVersion 属性设置为 12.0 而不是 4.0。对 .vcxproj.filters 执行相同的操作。

If you get some "SetEnv" related errors just rebuild those projects that failed.

如果您遇到一些与“SetEnv”相关的错误,只需重建那些失败的项目。

Verified on multiple machines to work.

在多台机器上验证可以工作。

回答by Sebastian Ax

NOTE: Weirdly this did only work for debug configuration. There seems to be missing some parts afterall. I ended up installing VS2013 express.

注意:奇怪的是,这仅适用于调试配置。毕竟似乎缺少一些部分。我最终安装了 VS2013 express。

If you are ok with having Visual Stuido 2015 installed you can either change your VS2015 current isntallation or newly install it. From the 2015 installer, select Windows 8.1 and Windows Phone 8.0/8.1 Tools and common Tools for Visual C++ 2015:

如果您对安装 Visual Stuido 2015 没问题,您可以更改 VS2015 当前安装或重新安装它。从 2015 安装程序中,选择 Windows 8.1 和 Windows Phone 8.0/8.1 工具和 Visual C++ 2015 的常用工具:

enter image description here

在此处输入图片说明

After installation completed, you will find the platform Toolset below (in my case VS2017):

安装完成后,你会在下面找到平台工具集(在我的例子中是 VS2017):

enter image description here

在此处输入图片说明

Credits: https://stackoverflow.com/a/42687137/4870255

学分:https: //stackoverflow.com/a/42687137/4870255