简体   繁体   中英

How do I install the boost library to my MinGW compiler?

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?

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 (eg boost thread, boost regex etc) which I beleive you're asking for

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:

  1. From your boost_X_XX_X directory, go to

     .\\tools\\build\\src\\engine 

    and type:

     build.bat mingw 
  2. This will create a folder called bin.ntx86 or bin.ntx86_64 depending on your architecture. Add this directory to your PATH environment variable.

  3. 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.

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM