Home Linux Community Community Blogs General Linux How to Build Boost using MinGW for windows OS including Windows 7

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++



Subscribe to Comments Feed
  • diki Said:

    BEASTLY!!! Thanks dude, this is the ONLY guide on compiling boost with mingw on the internet that actually works!!

Upcoming Linux Foundation Courses

  1. LFD211 Introduction to Linux for Developers
    09 Feb » 10 Feb - Virtual
  2. LFD411 Embedded Linux Development
    09 Feb » 13 Feb - Mississauga - ON
  3. LFD312 Developing Applications For Linux
    16 Feb » 20 Feb - Atlanta - GA

View All Upcoming Courses

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board