How do I build Boost 1.55 with MinGW?
First make sure your mingw's bin directory is in your environment PATH
so gcc
and g++
is callable from your command prompt. Afterwards go into your boost's root directory of where you extracted the files.
Follow that with a bootstrap + b2.exe to build. For example, let's say you only want to compile the regex portion of boost. The follow commands should do the trick:
bootstrap gccb2 toolset=gcc regex
You can use:
b2 --show-libraries
to get a listing of modules you can build individually. Of course you can build all of them with just:
b2 toolset=gcc
Check out Boost Invocation for a detailed list of available options.
Greatwolf's answer didn't work for me, so here's how I managed to get it working.
First, make sure MinGW\bin
is on your path
Go to the tools\build\v2
directory of your boost folder. For example, in my case it was C:\Boost\boost_1_55_0\tools\build\v2
. Then run
bootstrap mingw
After that, switch to the root Boost directory (this part is important since b2 detects what to build based on current directory)
Now, if you want to build Filesystem, do
tools\build\v2\b2 toolset=gcc --build-type=complete stage --with-filesystem
This will put libboost_filesystem-mgw48-d-1_55.dll
etc. in stage\lib
. If you want to build everything, just leave off the --with-filesystem
part.
I was able to build it following the instructions from Antimony. However I initially got this error:
Bootstrapping the build engine\Windows was unexpected at this time.
The error was solved by clearing the PATH variable and putting just the MinGW folder in it:
set PATH=C:\MinGW\bin
Then Antimony's instructions did the job for me. Thanks!!
Just two other small things that might be helpful. BOOST for MinGW should be build from the Windows shell, not from the MSYS shell. And in version 1.57 the bootstrap.bat script is no longer in tools\build\v2, but directly in tools\build.