I'm compiling from the command line using g++ on a Windows MinGW installation. How do I get boost...conceptually or if it is easy...what do I need to download and install?
-
28Prepare for great pain and suffering. – Lightness Races in Orbit Oct 21 '11 at 10:06
-
Did you not read the Boost installation instructions? Which parts are you struggling with? – Lightness Races in Orbit Oct 21 '11 at 10:07
-
3If you are flexible about what compiler you can use, it's significantly easier to install Boost for Visual C++, as BoostPro provides binaries and an installer: http://www.boostpro.com/download/. If you must use MinGW, there are a couple options. 1 - Use STL's mingw/gcc distribution, which comes with a prebuilt Boost 1.47.0 and is neatly packaged (http://nuwen.net/mingw.html). STL works on the Visual Studio software at Microsoft. 2 - Download the source code for boost from boost.org, and follow these instructions: http://www.boost.org/doc/libs/1_47_0/doc/html/bbv2/installation.html – wkl Oct 21 '11 at 15:56
-
1I'll try nuwen despite the web site...seriously how could something so useful...be on this web-site...shouldn't this be on sourceforge.net or similar? – Oct 30 '11 at 00:05
-
3@ChrisAaker: Because that's Stephan T. Lavavej's web-site. And he's a boss. See his videos on Channel 9. http://channel9.msdn.com/Tags/stephan-t-lavavej – Benjamin Lindley Oct 30 '11 at 00:47
-
This may be of help http://stackoverflow.com/questions/14181832/install-boost-on-windows-with-codeblocks/14186795#14186795 – StoryTeller - Unslander Monica Jan 20 '13 at 23:34
4 Answers
I know this is an old question but for future reference for anybody coming to this page try this website, http://nuwen.net/mingw.html
They have done all the hard work so you don't have to. The most recent distribution on this page has boost 1_52_0 (which is the latest version on the boost website as I'm writing this) including the separately compiled libraries (e.g. boost thread, boost regex etc) which I beleive you're asking for

- 843
- 11
- 22
-
2Thank you. Compared to Mac/FreeBSD/Linux boost is such a pain to compile and install. – kometen Feb 04 '16 at 18:49
I spent hours searching for a good solution for Boost 1.54. If you already have MinGW and you're just looking for instructions on compiling the binary boost libraries, try this:
From your boost_X_XX_X directory, go to
.\tools\build\src\engine
and type:
build.bat mingw
This will create a folder called
bin.ntx86
orbin.ntx86_64
depending on your architecture. Add this directory to your PATH environment variable.Return to your boost_X_XX_X directory and type:
bjam toolset=gcc
This worked for me on my system. I'd be interested to know if other systems have trouble with these instructions.

- 88,195
- 71
- 364
- 509

- 2,055
- 3
- 26
- 49
-
1This no longer works. There is no v2 directory. There is `./tools/build/src/engine.bat` though. Haven't tried it yet. – Timmmm Jan 29 '16 at 11:48
However there would have been a simpler, yet identical way; your steps until the bjam call are automatically done by bootstrap.bat:
C:\boost_1_52_0> bootstrap.bat mingw
Building Boost.Build engine
...
C:\boost_1_52_0> b2 toolset=gcc
Reference: https://stackoverflow.com/a/13257930/2171309

- 7,434
- 6
- 42
- 59

- 1,304
- 1
- 14
- 25
-
1This works, the `mingw` target however does not exist anymore. Just use the `gcc` target, – Ortwin Angermeier Sep 30 '17 at 16:50
Thanx to Neal Kruis. This worked for me. I have Qt 5.4 with mingw 4.9 installed. I downloaded boost 1.59. Go to "...\boost_1_59_0\tools\build\src\engine\" folder
set PATH=%PATH%;c:\Qt\Qt5.4.0\Tools\mingw491_32\bin
build.bat mingw
go to "...\boost_1_59_0\" folder, change boost path accordingly
set PATH=%PATH%;c:\boost_1_59_0\tools\build\src\engine\bin.ntx86
bjam toolset=gcc

- 21
- 1