Linux上安装Boost C++ Libraries

Boost C++ 库(Libraries)是一组扩充C++功能性的经过同行评审(Peer-reviewed)且开放源代码程序库。大多数的函数为了能够以开放源代码、封闭项目的方式运作,而授权于Boost软件授权条款(Boost Software License)之下。许多Boost的开发人员是来自C++标准委员会,而部份的Boost库成为C++的TR1标准之一。[1]

为了要确保库的效率与弹性,Boost广泛的使用模板(template)功能。而它是针对各式领域的C++用户与应用领域(Application Domain)上,包含的库类从像smart_ptr 库这种类通用库,到像是文件系统操作系统抽象层,甚至能够利用Boost来开发额外的库或是给高级的C++用户利用,像是MPL


Boost的安装

参考官方的安装文档,利用 Easy Build and Install 可以进行方便的安装。

Issue the following commands in the shell (don't type $; that represents the shell's prompt):


$ cd path/to/boost_1_47_0

$ ./bootstrap.sh --help

Select your configuration options and invoke ./bootstrap.sh again without the --help option. Unless you have write permission in your system's /usr/local/ directory, you'll probably want to at least use


$ ./bootstrap.sh --prefix=path/to/installation/prefix

to install somewhere else. Also, consider using the --show-libraries and --with-libraries=library-name-list options to limit the long wait you'll experience if you build everything. Finally,


$ ./b2 install

will leave Boost binaries in the lib/ subdirectory of your installation prefix. You will also find a copy of the Boost headers in the include/ subdirectory of the installation prefix, so you can henceforth use that directory as an #include path in place of the Boost root directory.


以上是1.47的安装方法,1.39也有类似的方法,但是生成的二进制程序叫做 bjam 而不是 b2。


参考资料:

1、Boost C++ Libraries

2、Get Started with Boost

3、Boost 1.39 编译安装手记

转载于:https://www.cnblogs.com/cocowool/archive/2011/08/18/2144142.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值