C++ Boost library v1.75.0 – how to build (x86) and install it – the basic approach

Build, install and test the C++ Boost Library (v1.75.0): the basic approach step-by-step to build and install the 32 bit version.


  1. The boost library has been downloaded from official Boost website. You can download in your preferred format, e.g. zip file.
  2. Microsoft Visual Studio 2015, 2017 or 2019 is already installed.

Why is important to check your Microsoft Visual studio version?

We have to build boost specifying which is the installed MS Visual Studio version, passing a specific parameter to the “booststrap.bat” script.

For MS Visual Studio 2019, this parameter is “vc142”. For the previous 2015 and 2017 versions, the parameter is “vc140” and “vc141” respectively.

Let’s build boost v1.75.0

  • Extract all files in the zip file to the destination folder (e.g., c:\boost). A new sub-folder will be created depending on the boost version (in this case, the sub-folder is named “boost_1_75_0”)
  • Type “bootstrap vc142” (if you have installed MS Visual Studio 2019)
Type "bootstrap vc142" in the folder where you have extracted all files from boost zip archive

Now, we are ready to build using “.\b2” command

Ready to start

To build boost, type “.\b2”

Let's type b2 command

Patience… it’s building

I suggest to watch a movie 🙂

The process requires a lot of patience

Boost C++ Libraries are successfully built!

How to use boost with Visual Studio?

  • Add the folder “c:\boost\boost_1_75_0” to the compiler include paths
  • Add the folder “c:\boost\boost_1_75_0\stage\lib” to the linker library paths
c++ boost library built successfully

Let’s test a basic example…

This code will produce a simple check failure for the test:

#include <boost/test/included/unit_test.hpp>
#include <iostream>
bool init_unit_test()
    std::cout << "using custom init" << std::endl;
    return true;

The console output will be:

using custom init
Running 1 test case...
C:/Users/UserPc/source/repos/FirstBoostTest/FirstBoostTest/FirstBoostTest.cpp(7): error: in "test1": check false has failed
*** 1 failure is detected in the test module "Master Test Suite"

As you have seen, the process to build and install boost 32-bit is not difficult. At each step, the instructions on how-to proceed are suggested.

Install boost binaries only

If you are not interested building boost but just to install boost, then you can simply download them from SourceForge. You can download boost binaries for all Microsoft Visual Studio versions or for a specific one.

If you have any question or you would like to contribute to this basic tutorial, feel free add your comment below.

Pietro L. Carotenuto
Pietro L. Carotenuto

C++ Software Engineer, Ph.D. in Information Engineering. I like reading and learning new things while working on new projects. Main author on PietroLC.com looking for contributions and guest authors.

Articles: 31

Leave your feedback here:

Your email address will not be published. Required fields are marked *