Monday 4 June 2012


Boost: A Guide to Building C++ Boost with MinGW (v1.48,  v1.49 and later)

As mentioned in the Boost Documents you only need to build a few of the libraries. These include regex, filesystem and Threads.

Where to get Boost:
Download the Library from: http://www.boost.org/users/download/




Where to get MinGW: http://www.mingw.org/ or http://sourceforge.net/projects/mingw/files/

Let get down to basics, unzip the zip file into C:\Boost, move the unzip folders into the following structure

c:\boost\
    - boost
    - doc
    - lib
    - more
    - stage
    - status
    - tools



Now start a command line for MinGW
Mini-guide
  • Run cmd.exe {command line windows should appear}
  • Add D:\mingw\bin {or wherever the WinGW installed}
    • Make sure no other compiler is included in the path like VC
    • I.e. path = %PATH%;C:\mingw\bin
    Hint: The windows command line has a default path (windows path), any changes made to the path inside the command line are not persisted or seen in other command line window. So, creating separate path batch(s) for the command line can be useful.

Now go to the boost folder


cd c:\boost\

Then execute (this will set the special building setting, it the magic)


bootstrap.bat 

Build 32 bit version of the libraries (not tested)
.\b2 --prefix=c:\boost\bin.v2 --toolset=gcc --build-type=complete stage

Build 64 bit version of the libraries (not tested)
.\b2 --prefix=c:\boost\bin.v2 --toolset=gcc --build-type=complete architecture=x86 address-model=64 stage  




Depending on PC specs the process can take several hours & build size is ~4Gb (per build version).

You will find the libraries in c:\boost\stage\

The intermediate files are located in c:\boost\bin.v2\ and sub folders

No comments:

Post a Comment