Boost 库的移植 与 Qt下的应用方法

1、下载boost源码(boost_1_66_0  2018.01.17 时最新):
地址:https://sourceforge.net/projects/boost/files/boost/
2、解压进入目录  boost_1_66_0    查看当前版本支持的库 如下:
命令:./bootstrap.sh --show-libraries
Building Boost.Build engine with toolset gcc... tools/build/src/engine/bin.linuxx86_64/b2

The following Boost libraries have portions that require a separate build
and installation step. Any library not listed here can be used by including
the headers only.

The Boost libraries requiring separate building and installation are:
    - atomic
    - chrono
    - container
    - context
    - coroutine
    - date_time
    - exception
    - fiber
    - filesystem
    - graph
    - graph_parallel
    - iostreams
    - locale
    - log
    - math
    - mpi
    - program_options
    - python
    - random
    - regex
    - serialization
    - signals
    - stacktrace
    - system
    - test
    - thread
    - timer
    - type_erasure
    - wave
3、去掉你不需要的库 指定安装目录,使用 --without-libraries=, , , 逗号隔开去掉不想编译的库,--prefix=/../ 指定编译后的安装路径
./bootstrap.sh --without-libraries=atomic,chrono,container,context,coroutine,date_time,exception,fiber,filesystem,graph,graph_parallel,iostreams,locale,log,math,mpi,program_options,python,random,regex,serialization,signals,stacktrace,test,timer,type_erasure
--prefix=/opt/GSRD/arm4.7.3_boost_1_66/

4、上一步骤会生成有 b2 和 bjam ,以及一个 project-config.jam 的文件,修改该文件的一行(指定自己的编译器):
注意:这中间是有空格的,更改Gcc编译器注意空格,gcc后面有一个空格,每个冒号后面有空格,末尾分号也有空格。
if ! gcc in [ feature.values <toolset> ]
{
    using gcc : : /home/sfe1012/MrcMoveProject/tools/gcc-linaro-arm-linux-gnueabihf-4.7-2012.11-20121123_linux/bin/arm-linux-gnueabihf-gcc ;
}
5、编译 安装
编译:./bjam 创建的 lib 文件默认在 stage 文件夹。
安装:./bjam install  进行安装到--prefix=/.../ 指定的目录。
6、QtGreator下的应用方法
在XX.pro工程目录中添加
指定头文件位置:INCLUDEPATH += /opt/GSRD/arm4.7.3_boost_1_66/include/

指定库文件位置及其 所应用的库:LIBS += -L /opt/GSRD/arm4.7.3_boost_1_66/lib/ -lboost_system -lboost_thread

参考:https://www.cnblogs.com/findumars/p/7461244.html

            http://blog.csdn.net/z609932088/article/details/50902302

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值