如何将 boost 库安装到我的 MinGW 编译器中?

发布于 2024-12-11 15:17:41 字数 77 浏览 0 评论 0原文

我在 Windows MinGW 安装上使用 g++ 从命令行进行编译。我如何获得提升...概念上或者如果很简单...我需要下载和安装什么?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

旧话新听 2024-12-18 15:17:41

我知道这是一个老问题,但为了以后访问此页面的人可以尝试此网站,以供参考,
http://nuwen.net/mingw.html

他们已经完成了所有艰苦的工作,因此您不必这样做。此页面上的最新发行版有 boost 1_52_0 (这是我撰写本文时 boost 网站上的最新版本),包括我相信您要求的单独编译的库(例如 boost 线程、boost regex 等)

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

眼眸 2024-12-18 15:17:41

我花了几个小时为 Boost 1.54 寻找一个好的解决方案。如果您已经拥有 MinGW 并且只是寻找有关编译二进制 boost 库的说明,请尝试以下操作:

  1. 从 boost_X_XX_X 目录,转到

    <前><代码>.\tools\build\src\engine

    并输入:

    build.bat mingw
    
  2. 这将创建一个名为 bin.ntx86bin.ntx86_64 的文件夹,具体取决于你的建筑。将此目录添加到您的 PATH 环境变量中。

  3. 返回到您的 boost_X_XX_X 目录并输入:

    bjam 工具集=gcc
    

这对我的系统有用。我很想知道其他系统是否在执行这些说明时遇到问题。

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.

ペ泪落弦音 2024-12-18 15:17:41

然而,还有一种更简单但相同的方法; bootstrap.bat 会自动完成 bjam 调用之前的步骤:

C:\boost_1_52_0> bootstrap.bat mingw
Building Boost.Build engine 
...
C:\boost_1_52_0> b2 toolset=gcc

参考:https://stackoverflow.com/a/13257930/2171309< /a>

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

云淡风轻 2024-12-18 15:17:41

感谢尼尔·克鲁斯。这对我有用。我安装了 Qt 5.4 和 mingw 4.9。我下载了boost 1.59。转到“...\boost_1_59_0\tools\build\src\engine\”文件夹

set PATH=%PATH%;c:\Qt\Qt5.4.0\Tools\mingw491_32\bin
build.bat mingw

转到“...\boost_1_59_0\”文件夹,相应地更改boost路径

set PATH=%PATH%;c:\boost_1_59_0\tools\build\src\engine\bin.ntx86
bjam toolset=gcc

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
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文