linux之boost编译

编译boost

下载boost

https://boostorg.jfrog.io/artifactory/main/release/

编译

wget https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.gz
tar -xvf boost_1_81_0.tar.gz
cd boost_1_81_0
./bootstrap.sh --with-libraries=all --with-toolset=gcc --without-libraries=python
./b2
./b2 install --prefix=/usr/local/boost

其他提示:
1.如果是 arm,报错为 选项 -m64 not found或者 unrecognized command line option ‘-m64’ 错误,请修改 bin.v2/project-cache.jam 文件内的arm- 值为true,然后执行 ./b2 &&./b2 install
2.如果是 fatal error: pyconfig.h: 没有那个文件或目录 ---- apt install python3.7-dev 删除目录重新生成
3.如果是 libs/iostreams/src/bzip2.cpp:20:56: fatal error: bzlib.h: No such file or directory :安装bzip2库即可 - yum install bzip2-devel.x86_64

./b2 的结果如下,即为编译成功:

common.copy stage/lib/libboost_wave.a
...updated 950 targets...


The Boost C++ Libraries were successfully built!

The following directory should be added to compiler include paths:

    /usr/local/boost

The following directory should be added to linker library paths:

   /usr/local/boost

[root@localhost boost_1_58_0]#
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值