Building Boost on Windows

In case you’ve never heard of it before, Boost is a set of peer reviewed libraries for C++. They provide a lot of features that are sorely missing from the standard C++ libraries and are probably the closest C++ developers have to a standard development toolkit. In fact, Boost is so useful that a number of the projects were included in the C++11 standard.

To install the official upstream version of boost you need to build it using bjam. This isn’t that hard but it’s not as simple as just installing a package. The good news is that most Linux distributions include native package installers. Windows developers are covered by the wonderful installer packages that are maintained by BoostPro.

The downside to using these packages is that you are tied in to the release cycle of the package maintainer. Often, Linux packages can be 2, 3, 4 or even more releases behind the official upstream. BoostPro does a pretty good job of keeping packages up-to-date but it’s still normally a release behind. Also, BoostPro may not have a package for your compiler or version.

The answer, of course, is to build Boost yourself but this can be a daunting prospect if you’ve never done it before. This article will cover building Boost for Windows for use with Visual Studio (it may be followed up by a similar article explaining how to build Boost for Linux).

Why am I focusing on Windows? A few reasons:

I actually need a Windows installation so now is a good a time as any to write this guide.

BoostPro doesn’t currently have an installer for Visual Studio 2012.

My experience is that building Boost on Windows is that it’s generally more problematic that doing so on Linux.

Linux developers are generally more used to messing around with the lower-levels of compilers, linkers and make files and so are less likely to find building Boost from scratch a daunting task.

So, here is a simple step-by-step guide to building Boost for Windows.

Like this:

Related

Published by evilrix

An expert in cross-platform ANSI C/C++ development; evilrix specialises in high performance/low latency solutions and complex meta-template programming techniques, using Boost and the C++11 ANSI standard.
View all posts by evilrix