Tuesday, December 28, 2010

Building Boost with MinGW

In this blog, I'm gonna show you how to build Boost using MinGW. Below are the versions that I use.
- gcc 4.5.0
- boost 1.45.0

All the steps below need to be executed on CMD and not on MSYS.
1. Download Boost
2. Extract it to let's say C:\boost_1_45_0
3. Build bjam tool.
cd C:\boost_1_45_0\tools\build\v2\engine\src
build.bat mingw
bjam will be created in C:\boost_1_45_0\tools\build\v2\engine\src\bin.ntx86
4. Copy the bjam tool to C:\boost_1_45_0
copy bjam.exe C:\boost_1_45_0
5. Build the boost libraries.
cd C:\boost_1_45_0
bjam toolset=gcc
The include header files are located in the C:\boost_1_45_0\boost and the libraries are located in the C:\boost_1_45_0\stage\lib

Enjoy! :)

1 comment:

  1. Thank you very much for posting this. Your information is valuable because of the following issues with the boost documentation. The documentation recommends a precompiled download of bjam that doesn't work with boost 1.45. I learned from a post on the GMANE archive that boost 1.45 must be built with the version of bjam that it comes with, which implies building bjam from source. The included instructions for building bjam reference a directory that doesn't exist.

    ReplyDelete