February 22, 2011

How to Build Boost using MinGW for windows OS including Windows 7

Follow these steps:

1. Download Boost from Boost WebSite
2. Extract it to the folder e.g. D:/Program Files/Boost_1_45_0
3. build bjam tool

run the below command on the command line from the path(given below) where you have extracted the Boost

Go to the folder where files has been extracted, eg D:/Program Files/Boost_1_45_0, then

cd tools/build/v2/engine/src
build.bat mingw    (mingw should be at path C:MinGW)

bjam will be created in: D:/Program Files/Boost_1_45_0/tools/build/v2/engine/src/in.ntx86

4. now copy the newly created bjam from D:/Program Files/Boost_1_45_0/tools/build/v2/engine/src/in.ntx86 to the boost root directory, D:/Program Files/Boost_1_45_0

5. Now to build boost libraries

go to D:/Program Files/Boost_1_45_0

bjam - -toolset=gcc   OR

bjam - -toolset=gcc - -build-type=complete stage

This will take time so wait-----

After all the targets build, the include header files are located in the D:/Program Files/Boost_1_45_0/boost and the libraries are located in the D:/Program Files/Boost_1_45_0/stage/lib


Now your C++ code is ready to use boost with g++

Click Here!