简体   繁体   English

vcvarsall无法将“ cl”识别为内部或外部

[英]'cl' is not recognized as an internal or external, vcvarsall

I've been trying to install Boost Libraries for 5 months now, yes very embarrassing, and currently this is the error I run into. 我已经尝试安装Boost Libraries已有5个月了,是的,这非常令人尴尬,目前这是我遇到的错误。

I am running this on Windows 7, 64 bit. 我在Windows 7(64位)上运行此程序。 Boost 1_59_0. 提高1_59_0。

I used the Visual Studio 2013 x64 Native prompt to go to the boost directory and ran 我使用Visual Studio 2013 x64本机提示符转到boost目录并运行

bootstrap.bat

and then 接着

b2 --toolset=msvc --build-type=complete architecture=x86 address-model=64 stage

However I get the error 但是我得到了错误

'cl' is not recognized as an internal or external command 'cl'不被识别为内部或外部命令

Following this , I ran ,我跑

vsvarsall amd64

from

C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC

I went back and tried running b2 again but I got the same error as before. 我回去尝试再次运行b2,但出现了与以前相同的错误。

I searched for "cl.exe" on my laptop and I found it here: 我在笔记本电脑上搜索了“ cl.exe”,并在这里找到了它:

C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin

C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_amd64

C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\x86_arm

C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64

C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64_arm

C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\amd64_x86

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_amd64

C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_arm

C:\Program Files (x86)\Microsoft Visual Studio 8\VC\bin

I understand that 'b2' is unable to find 'cl' and I have to give the 'path' to the 'cl.exe' but I don't know how to set path, what to type where etc. I thought that 'vsvarsall' was supposed to fix this but it didn't. 我知道'b2'找不到'cl',我必须将'path'赋予'cl.exe',但是我不知道如何设置路径,在何处键入内容等。我认为vsvarsall'应该可以解决此问题,但没有解决。

Please help. 请帮忙。

EDIT 1: 编辑1:

I set path following the instructions given in the comments, but I am still getting the same errors. 我按照注释中给出的说明设置了路径,但是仍然遇到相同的错误。

在此处输入图片说明

In your log, you have a number of calls to "C:\\Users....\\b2_msvc_12.0_vcvarsall_amd64.cmd". 在您的日志中,您有许多对“ C:\\ Users .... \\ b2_msvc_12.0_vcvarsall_amd64.cmd”的调用。 This is a file that caches the environment that VC needs. 这是一个缓存VC所需环境的文件。 Could you try deleting it, in case it got stale value from older version? 如果它从旧版本获得过时的价值,您可以尝试删除它吗?

You need to make sure that you run vsvarsall.bat and in the same cmd window run bootstrap and b2. 您需要确保运行vsvarsall.bat,并在同一cmd窗口中运行bootstrap和b2。 Since the env variables are only set for that shell. 由于env变量仅针对该shell设置。 Otherwise add the paths set by vsvarsall.bat manually in environment variables for the system. 否则,将vsvarsall.bat设置的路径手动添加到系统的环境变量中。

You can search your control panel to find where to set environment variables, or hit the windows key and type in environment variables. 您可以在控制面板中搜索以找到设置环境变量的位置,或者按Windows键并键入环境变量。 You will get a shortcut to the window for those settings. 您将获得这些设置窗口的快捷方式。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM