Boost 库 - 只构建我需要的 [英] Boost libraries - build only what I need

查看:20
本文介绍了Boost 库 - 只构建我需要的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我下载了 Boost 库,现在我只想构建几个库.什么是正确的命令?显然,built-type=complete 选项给了我太多.我使用的是 Windows XP,想使用 Bjam 编译 Boost 和 MinGW 以最终使用它.目前我认为我需要 Boost.filesystem、Boost.ProgramOptions 和 Boost.System 库.另一个问题:我应该把头文件库放在哪里?

I downloaded the Boost libraries and now I want to build only a few of the libraries. What would be the right command for this? Apparently the built-type=complete option gives me too much. I am using Windows XP and want to use Bjam to compile Boost and MinGW to finally use it. At the moment I think I need the libraries Boost.filesystem, Boost.ProgramOptions and Boost.System. Another question: Where do I put the header-only libraries?

推荐答案

步骤 5.2.4入门 您可以指示b2 构建哪些库:

In step 5.2.4 of Getting Started you can instruct b2 which libraries to build:

./b2 --with-program_options --with-filesystem --with-system

或者,使用 ./b2 --show-libraries 查看所有不是仅标头的库的列表.

Alternatively, use ./b2 --show-libraries to see a list of all libraries that are not header-only.

以下是页面的摘录:

特别是,要限制构建所花费的时间,您可能会感兴趣:

In particular, to limit the amount of time spent building, you may be interested in:

  • 使用--show-libraries查看库名称列表
  • 限制使用 --with---without- 选项构建哪些库
  • 通过向命令行添加发布或调试来选择特定的构建变体.
  • reviewing the list of library names with --show-libraries
  • limiting which libraries get built with the --with-<library-name> or --without-<library-name> options
  • choosing a specific build variant by adding release or debug to the command line.

注意: b2 命令取决于 boost 版本,因此请根据您的 boost 版本使用以下命令(此外,在这种情况下,请使用 --with-libraries= 版本而不是 --with-):

Note: b2 command depends upon boost version so use following commands as per your boost version(Also, in this case use --with-libraries=<comma-seperated-library-names> version instead of --with-<library-name>):

  • ./configure 适用于 1.38.0 及更早版本
  • ./bootstrap.sh 用于 1.39.0 直到 1.46.0
  • ./configure for 1.38.0 and earlier
  • ./bootstrap.sh for 1.39.0 onwards till 1.46.0

这篇关于Boost 库 - 只构建我需要的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆