How to use the Boost compiled libraries in Windows

As stated on the boost.org Getting Started for Windows page, most Boost libraries are header-based that require no separate compilation. But there exist some Boost libraries that require a separate compilation in order to use them. This page essentially reiterates what is already explained in section 5.2.1 of the Getting Started page, but with additional screenshots to make it easier for newcomers.

A previous post dealt with the separate compilation of Boost library binaries using BoostPro, but this package is no longer supported, alas.Step 1

Unzip your boost download to the folder of your choice. The following screenshot shows what mine looks like. Ignore this step if you have previously done this.

Step 2.

Open a command prompt and navigate ( ‘cd‘ ) to the location of your boost root folder. You may want to enclose the path in quotation (“) marks if the path contains any whitespaces:

Step 3.

Run the bootstrap command:

Step 4.

Run .\b2 from the command prompt. This can take quite some time to finish:

Step 5.

Try it out on a Boost library that is known to require separate compilation: Boost.Regex for example.