Visual Studio 2017:工具集 v140 的 vcvars [英] Visual Studio 2017: vcvars for toolset v140

查看:62
本文介绍了Visual Studio 2017:工具集 v140 的 vcvars的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我安装了 Visual Studio 2017 和工具集 v140v141.要使用 v140 工具集,我需要通过 vcvars 设置必要的环境.但是,运行必要的 vcvars 时,我遇到了各种错误.我正在从此目录中获取 vcvars - C:\Program Files (x86)\Microsoft Visual Studio\Shared\14.0\VC - 因为我需要为使用 v140 工具集.

I installed Visual Studio 2017 and toolsets v140 and v141. To work with v140 toolset, I need to set the necessary environment via vcvars. However, running the necessary vcvars, I get various errors. I am taking vcvars from this directory - C:\Program Files (x86)\Microsoft Visual Studio\Shared\14.0\VC - as I need to initiate the environment for the work with v140 toolset.

例如,如果我运行 vcvarsall,然后 vcvarsall.bat x86vcvarsall.bat x86_amd64 - 我收到以下错误:

If I run vcvarsall, for example, then vcvarsall.bat x86 or vcvarsall.bat x86_amd64 - and I get the following error:

脚本使用错误.正确的用法是:

Error in script usage. The correct usage is:

vcvarsall.bat [选项]
vcvarsall.bat [option] store
vcvarsall.bat [选项] [版本号]
vcvarsall.bat [option] 存储[版本号]

其中 [选项] 是:x86 |amd64 |手臂|x86_amd64 |x86_arm |amd64_x86 |>amd64_arm
其中 [版本号] 是完整的 Windows 10 SDK 版本号或8.1"使用windows 8.1 SDK

where [option] is: x86 | amd64 | arm | x86_amd64 | x86_arm | amd64_x86 | >amd64_arm
where [version number] is either the full Windows 10 SDK version number or "8.1" to use the windows 8.1 SDK

:商店参数集支持商店(而不是桌面)的环境变量发展.:

: The store parameter sets environment variables to support store (rather than desktop) development. :

例如:

vcvarsall.bat x86_amd64
vcvarsall.bat x86_arm 存储
vcvarsall.bat x86_amd64 10.0.10240.0
vcvarsall.bat x86_arm 存储 10.0.10240.0
vcvarsall.bat x64 8.1
vcvarsall.bat x64 存储 8.1 :

请确保安装了 Visual Studio 或 C++ Build SKU.

Please make sure either Visual Studio or C++ Build SKU is installed.

如果我运行一个特定的文件 vcvars,例如 vcvars32.bat,然后我得到另一个错误:

If I run a specific file vcvars, for example, vcvars32.bat, then I get another error:

错误:无法确定 VS Common Tools 文件夹的位置.

ERROR: Cannot determine the location of the VS Common Tools folder.

有没有人遇到过同样的问题,你能帮忙吗?谢谢.

Has anyone had the same issue, could you help? Thank you.

推荐答案

我已经设法解决了,可以说,这个问题使用以下方法.对于工具集 v140 vcvars 尝试从注册表(Visual Studio 14.0 安装目录)获取所需的数据,但由于未能这样做,因此退出并出现错误.如果您将所需的值添加到 Windows 注册表,vcvars 将正常工作.如果工具集 v140 与 Visual Studio 2017 一起安装,此默认安装路径为 C:\Program Files (x86)\Microsoft Visual Studio\Shared\14.0\.

I've managed to solve, so to speek, this issue using the following approach. For toolset v140 vcvars tries to obtain the required data from the registry (Visual Studio 14.0 installation directory), but, because it fails to do so, exits with an error. If you add to the Windows registry the required value, vcvars will work correctly. In case of toolset v140 installed along with Visual Studio 2017 this path for the default installation is C:\Program Files (x86)\Microsoft Visual Studio\Shared\14.0\.

您需要找到设置 Visual Studio 2017 安装目录的现有密钥(在我的情况下是 HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7)并添加密钥名称为 14.0,值为 C:\Program Files (x86)\Microsoft Visual Studio\Shared\14.0\

You need to locate the existing key where the Visual Studio 2017 installation directory is set (in my case it is HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\VisualStudio\SxS\VS7) and add the key with name 14.0 and value C:\Program Files (x86)\Microsoft Visual Studio\Shared\14.0\

这篇关于Visual Studio 2017:工具集 v140 的 vcvars的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆