2

I've been trying to install Boost Libraries for 5 months now, yes very embarrassing, and currently this is the error I run into.

I am running this on Windows 7, 64 bit. Boost 1_59_0.

I used the Visual Studio 2013 x64 Native prompt to go to the boost directory and ran

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

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.

I searched for "cl.exe" on my laptop and I found it here:

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.

Please help.

EDIT 1:

I set path following the instructions given in the comments, but I am still getting the same errors.

enter image description here

Amatya
  • 1,203
  • 6
  • 32
  • 52
  • 1
    You go to your _System Settings_ and add it to the `PATH` or `Path` environment variable? – πάντα ῥεῖ Sep 08 '15 at 19:00
  • Hi ttanta, I don't know how to do any of that. I am googling how to find "system settings" right now. – Amatya Sep 08 '15 at 19:28
  • _"ttanta"_ LOL, nice try for a transcript :-) (panta if so, or @πάντα ῥεῖ simply) Here's some hints:http://stackoverflow.com/questions/9546324/adding-directory-to-path-environment-variable-in-windows – πάντα ῥεῖ Sep 08 '15 at 19:35
  • @πάντα ῥεῖ ah, that was a pi! Panta Rei. So I set path both going the "My Computer" > "Properties" > "Advanced" > "Environment Variables" > "Path" route and also doing set PATH=%PATH%;C:\blah\blah\VC\bin on cmd.exe and then exited the command window and logged back in but still the same error. – Amatya Sep 08 '15 at 20:16
  • 1
    Beware that environment variables set by `vsvarsall.bat` are only set in the shell you call that from and processes started from that shell, are you aware of that? – Ulrich Eckhardt Sep 08 '15 at 20:31
  • @UlrichEckhardt I didnt. Thx for point that out. I again ran everything (vcvarsall and then b2) from the same VS2013 x64 Native Tools command prompt but I still get the same error. – Amatya Sep 08 '15 at 20:46
  • 1
    I would take a wild guess and say that your problem is that you have a 64-bit operating system but your installed compilers are all 32-bit. Only a guess. – john Sep 08 '15 at 21:24
  • @john Thx for your comment. How can I go about verifying it and fixing it? I'll google in the mean time. – Amatya Sep 08 '15 at 21:55
  • @πάνταῥεῖ that's not good advice. The VCVARS* batch files exist for a very good reason. – sehe Sep 09 '15 at 09:05
  • 1
    My $0.02 I've seen this happening on systems where I had previously installed (and removed) versions of VS. Make sure you start the right VCVARS (that fixed it for me. Apparently, stuff lingers) – sehe Sep 09 '15 at 09:07

2 Answers2

2

In your log, you have a number of calls to "C:\Users....\b2_msvc_12.0_vcvarsall_amd64.cmd". This is a file that caches the environment that VC needs. Could you try deleting it, in case it got stale value from older version?

Vladimir Prus
  • 4,600
  • 22
  • 31
  • Cheers. Deleted `b2_msvc_14.1_vcvars32_.cmd` & `b2_msvc_14.1_vcvarsx86_amd64_.cmd` after changing Visual Studio versions and this resolved my issue. – gavxn Mar 26 '18 at 18:07
0

You need to make sure that you run vsvarsall.bat and in the same cmd window run bootstrap and b2. Since the env variables are only set for that shell. Otherwise add the paths set by vsvarsall.bat manually in environment variables for the system.

You can search your control panel to find where to set environment variables, or hit the windows key and type in environment variables. You will get a shortcut to the window for those settings.

meTOO
  • 1