Build Boost on Windows with MinGW

Short reminder on how to build Boost on Windows with MinGW. Versions used in this how-to :

  • Boost 1.63, uncompressed in c:\src\libs\boost_1_63_0.
  • MinGW-w64 targeting 32bits, GCC 6.2, posix, sjlj. The bin subfolder is in the PATH environnement variable.

Steps :

  • Installing Boost.Build building tool.
  • Compiling Boost, selecting what to compile.

Install Boost.Build

Not sure exactly why this is needed, but let’s do it anyway… It will be installed in c:\src\libs\boost_1_63_0\BOOST.BUILD. Note: « mingw » toolset, while mentionned in the documentation, does not work. Use toolset « gcc » instead, it supports MinGW compiler.

Building Boost

When no build folder is selected, Boost.Build will build in c:\src\libs\boost_1_63_0\bin.v2, and libs will be available in C:\src\libs\boost_1_63_0\stage

You might get errors like the following :

I got this kind of error trying to build with TDM-GCC 5.1, and solved it by not building shared libraries (I usually use static so I can distribute small tools) :

Laisser un commentaire

Votre adresse de messagerie ne sera pas publiée. Les champs obligatoires sont indiqués avec *

67 − = sixty five