Sunday 18 March 2012

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

This guide is especially useful if multiple installation of Visual Studio C++ (tested with Visual Studio 2008 and 2010)

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/

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 Visual Studio C++ command line

cd c:\boost\

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

bootstrap.bat

Build options
--prefix=c:\boost\bin.v2, where the intermediate files will be located
--toolset=msvc-9.0, Toolset MSVC, version 9.0
--build-type=complete stage, see the RTFM :-)

Visual Studio 2008 (32 bit version) (use VC++ 32bit command line)

.\b2 --prefix=c:\boost\bin.v2 --toolset=msvc-9.0 --build-type=complete stage

Visual Studio 2008 (64 bit version)
(use VC++ 64bit command line)

.\b2 --prefix=c:\boost\bin.v2 --toolset=msvc-9.0 --build-type=complete architecture=x86 address-model=64 stage


Visual Studio 2010 (32 bit version)
(use VC++ 32bit command line)
.\b2 --prefix=e:\boost\bin.v2 --toolset=msvc-10.0 --build-type=complete stage

Visual Studio 2010 (64 bit version, not tested)
(use VC++ 64bit command line)
.\b2 --prefix=c:\boost\bin.v2 --toolset=msvc-10.0 --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