2

Has anyone had any success in building boost 1.61.0 for Mingw? I've Googled for this, and all the suggestions that apparently worked well in the past result in errors now. It doesn't help that boost's "Getting Started on Windows" page is a poorly structured, incomplete mess that seems to have been getting only the most rudimentary updates for a while now (there are even a couple of dead links in there). I somehow managed to build boost 1.58 for an older MinGW version, but that was quite a while ago and I foolishly neglected to write down the individual steps required to make it work. :-\

2 Answers 2

14

Ok, I did get it to work, but apparently the bug in the boost build system discussed here is still in boost 1.61. I worked around that by skipping the libraries that run into this problem and only building the ones that I need. Here's what worked for me.

  1. Download and unzip boost_1_61_0.7z to D:\Dev\Libs\boost\boost_1_61_0
  2. Extend PATH variable to contain bin folder that contains MinGW g++.exe, and make sure no other g++.exe instances appear in PATH before this one (that actually tripped me up the first time, because several programs I've installed come packaged with their own g++ version).
  3. Open cmd window.
  4. Run cd D:\Dev\Libs\boost\boost_1_61_0\tools\build
  5. Run .\bootstrap.bat (if you skip this, step 6 will fail with 'Unknown toolset: mingw' ... WTF???)
  6. Run .\bootstrap.bat mingw
  7. Run .\b2.exe install toolset=gcc --prefix=D:\Dev\Libs\boost\boost_1_61_0\b2_for_mingw
  8. Run cd D:\Dev\Libs\boost\boost_1_61_0
  9. Run set PATH=%PATH%;D:\Dev\Libs\boost\boost_1_61_0\b2_for_mingw\bin
  10. Run b2 toolset=gcc --build-type=complete stage --with-filesystem --with-system (since I only need the filesystem and system libraries).

EDIT: For boost 1.64, step 5 must be skipped entirely, and in step 6 gcc needs to be specified instead of mingw, as pointed out in the comments by user fest.

2
  • 5
    For boost 1.63, I had to use .\bootstrap.bat gcc in step 6.
    – fest
    Feb 19, 2017 at 13:24
  • 4
    As of 1.64, mingw is again a toolset option but doesn't seem to work. The Boost.Build documentation (link) seems to recommend gcc option for using mingw anyway.
    – arthropod
    May 13, 2017 at 1:44
2

The answer from @antred worked pretty well. Only changes I needed to do to compile boost 1.67.0 is follows:

  • Instead of step 5 and 6 run .\bootstrap.bat gcc
  • At step 10 run b2 --build-dir="C:\Program Files\boost_1_67_0\build" --prefix="C:\Program Files\boost" toolset=gcc install

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.