0

I'm unable to install the latest version of Boost, i.e. 1.61. What I did was to run "bootstrap.bat" from the boost root folder in Windows 7 prompt command, but error message says:

Building Boost.Build engine The system cannot find the path specified.

Failed to build Boost.Build engine. Please consult bootstrap.log for further diagnostics.

Any help appreciated!

Paul R
  • 208,748
  • 37
  • 389
  • 560
fqx
  • 101
  • 1
  • 1
  • 1
    "Please consult bootstrap.log for further diagnostics." -- have you done that? What does the log say? – Dan Mašek May 27 '16 at 15:50
  • it says "ERROR: Cannot determine the location of the VS installation." The VS12 is installed at "C:\Program Files (x86)\Microsoft Visual Studio 12.0" – fqx May 27 '16 at 15:55
  • 1
    Are you actually running it from the "Visual Studio" command prompt, or have you configured the environment appropriately (e.g. by running something like `call "%VS120COMNTOOLS%..\..\VC\vcvarsall.bat" x86`)? – Dan Mašek May 27 '16 at 16:06
  • Check out my answer here: http://stackoverflow.com/questions/35217511/boost-1-60-0-zip-installation-in-windows/35223257#35223257 it's for `VS2015` and `boost 1.60`, but the approach should work fine for `VS2012` and `boost 1.61` too. – kenba May 27 '16 at 16:22
  • @DanMašek Yes, I ran it from VS command prompt "Developer Command Prompt for VS2013". And from where I called "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC>vcvarsall.bat". The error msg says "The system cannot find the path specified. ERROR: Cannot determine the location of the VS installation." – fqx May 27 '16 at 17:02
  • @kenba Thanks for the procedures but the my problem was not being able to run bootstrap.bat – fqx May 27 '16 at 17:04

2 Answers2

4

If you got boost from git, be sure that you've checkout out any relevant submodules. In my case, the missing one was tools/build, which I got via:

git submodule update --init -- "tools/build"

If you're not sure what you need, you can also just load everything

git submodule update --init --recursive

MatrixManAtYrService
  • 8,023
  • 1
  • 50
  • 61
0

I believe this is not necessary a problem with either Boost C++ Libraries or Boost.Build, but rather with VS installation. The error comes from vcvars64.bat:

@call "%VS120COMNTOOLS%VCVarsQueryRegistry.bat" No32bit 64bit  
@if "%VCINSTALLDIR%"=="" goto error_no_VCINSTALLDIR
...
:error_no_VSINSTALLDIR
@echo ERROR: Cannot determine the location of the VS installation.

Where the VCVarsQueryRegistry.bat script does something like

@for /F "tokens=1,2*" %%i in ('reg query   "%1\SOFTWARE\Microsoft\VisualStudio\SxS\VS7" /v "12.0"') DO (
    @if "%%i"=="12.0" (
        @SET "VSINSTALLDIR=%%k"
    )
)

What does your registry have, under both HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7 and HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7? In any case, it sounds like incomplete VS installation at this point.

Vladimir Prus
  • 4,600
  • 22
  • 31
  • can this be a missing system environment variable? – Minzkraut May 30 '16 at 15:22
  • That's not likely, the scripts I see exclusively look at registry - and *then* set environment variables. – Vladimir Prus May 30 '16 at 15:25
  • @VladimirPrus Thank you. I checked my register and found the the key with name 12.0 under HKLM\SOFTWARE\Microsoft\VisualStudio\SxS\VS7 specifies incorrectly the address of VS12, i.e. points it to C:\Program Files\Microsoft Visual Studio 12.0\ rather C:\Program Files (x86)\Microsoft Visual Studio 12.0\. But I did not find HKCU\SOFTWARE\Microsoft\VisualStudio\SxS\VS7. After this, I ran bootstrap.bat from the Boost root and got error msg "The system cannot find the path specified. '.\build.bat' is not recognized as an internal or external command,operable program or batch file." Any idea? Thx – fqx May 31 '16 at 09:02
  • Are you using native Windows command line, or MinSys? If you're using native Windows command line, it sounds like you do not have tools\build\src\engine directory, or it's empty. If you used git, you need to fetch submodules. If you're using MinSYS, you need to use bootstrap.sh. – Vladimir Prus May 31 '16 at 09:06
  • @VladimirPrus I followed suggestions on another post to run bootstrap.bat from the boost build directory. It seemed to me it created the a b2 application so in the next step I ran "b2 toolset=msvc-12.0 --build-type=complete --abbreviate-paths architecture=x86 address-model=64 install -j4". It started to copy files and the whole process ended in a couple of mins with final msg "...updated 327 targets...". The size of the boost folder is just under 600m. I don't think Boost was successfully built. But I don't know what I can do next. – fqx May 31 '16 at 09:08
  • @VladimirPrus I used Developer Command Prompt for VS2013. On my side, I have C:\Boost\1_61_0\tools\build\src\engine directory and it is not empty. – fqx May 31 '16 at 09:10
  • It sounds like you have run b2 from `tools\build` directory, not the Boost root. – Vladimir Prus May 31 '16 at 10:49
  • @VladimirPrus I copied b2 from tools\build to the Boost root and ran from there. It finally worked. However, a new issue emerged "fatal error C1001: An internal error has occurred in the compiler (compiler file 'msc1.cpp', line 1325)". I have updated VS12 with update 5. – fqx Jun 01 '16 at 08:31