28

I am trying to find an authorative answer on how to build Boost 1.52 with MinGW. I found some pointers in the Internet that boil down to build it like so:

cd tools\build\v2\engine
build.bat mingw

copy bin.ntx86\bjam.exe ..\..\..\..
cd ..\..\..\..
bjam --toolset=gcc

Since those instructions date back as far as for Boost 1.45 and since I couldn't verify this with Boost's own instructions I'd like to verify if the steps above are the correct ones to build Boost with MinGW.

I tried these steps myself and it seemed to build Boost, however I have not yet done extensive testing (nor would I have a concept to do this).

René Nyffenegger
  • 39,402
  • 33
  • 158
  • 293

1 Answers1

65

Yes, that is correct. However there would have been a simpler, yet identical way; your steps until the bjam call are automatically done by bootstrap.bat:

C:\boost_1_52_0> bootstrap.bat mingw
Building Boost.Build engine
...
C:\boost_1_52_0> b2 toolset=gcc

If not explicitly specified, the libraries will be placed into the stage\lib directory, include path is the installation root. To test the installation, you can use the example from Link Your Program to a Boost Library.

References: Installation, Prepare to Use a Boost Library Binary

Lightness Races in Orbit
  • 378,754
  • 76
  • 643
  • 1,055
Anonymous Coward
  • 6,186
  • 1
  • 23
  • 29
  • 2
    Just did this with `1.53.0` and `mingw-x64` and worked perfectly – Matt Clarkson Feb 28 '13 at 12:00
  • Do you know how to get all built dlls in one folder (possibly stage\lib) if I you only build some dlls? Namely, how should I modify a command like this: `b2 filesystem system regex program_options variant=debug,release toolset=gcc link=shared -j 7` – Antonio Jun 20 '13 at 08:09
  • 3
    Ok, I answer my own question: instead of listing the project like that, use: `b2 --with-filesystem --with-system --with-regex --with-program_options variant=debug,release toolset=gcc link=shared -j 7` – Antonio Jun 20 '13 at 08:43
  • Antonio, have you successfully linked to your libs build this way? – kjoppy Jul 03 '13 at 03:05
  • 1
    It's been `b2`, not `bjam`, for several years (though, for a while, bjam was still supported for backwards-compatibility with old user scripts; I'm unsure whether it still is as of v1.54.0, mind you; the above worked perfectly for me on that version with my edit in place.) – Lightness Races in Orbit Jul 06 '13 at 21:23
  • The only answer the works for me after searching for hundreds of pages in web! Thanks :D – mr5 Dec 08 '13 at 02:22