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

后端 未结 4 1942
攒了一身酷
攒了一身酷 2021-01-31 18:57

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?

相关标签:
4条回答
  • 2021-01-31 19:11

    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
    
    0 讨论(0)
  • 2021-01-31 19:13

    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

    0 讨论(0)
  • 2021-01-31 19:16

    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

    0 讨论(0)
  • 2021-01-31 19:19

    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.

    0 讨论(0)
提交回复
热议问题