linux升级boost库,Centos 安装boost库

1.在http://www.boost.org/下载boost安装包boost_1_65_1.tar.gz

2.在Centos上解压tar -zxvf  boost_1_65_1.tar.gz后,cd进入boost_1_65_1目录

3.安装boost库到指定目录

./b2 install --prefix=/home/dj/lib/boost/

4.如果为了引用方便将目录加到环境变量中

在/etc/profile文件中添加

export CPLUS_INCLUDE_PATH=/home/dj/lib/boost/include:$CPLUS_INCLUDE_PATH

export LIBRARY_PATH=/home/dj/lib/boost/lib:$LIBRARY_PATH

export LD_LIBRARY_PATH=/home/dj/lib/boost/lib:$LD_LIBRARY_PATH

安装出现问题:

1.fatal error: pyconfig.h: No such file or directory,

缺少python依赖包

Ubuntu上 apt-get install python-dev

Centos上 yum install python-devel

2.Fatal error: can't create bin.v2/libs/python/build/gcc-4.8.5/release/link-static/threading-multi/converter/from_python.o: Permission denied

权限被限制

使用 sudo ./b2 install --prefix=/home/dj/lib/boost/

3.编译程序出现错误

/usr/bin/ld: build/objs/Wrap.o: undefined reference to symbol 'pthread_kill@@GLIBC_2.2.5'

/lib64/libpthread.so.0: error adding symbols: DSO missing from command line

在Makefile文件中 LIBS 添加 pthread

4.error while loading shared libraries: libboost_system.so.1.65.1: cannot open

这是找不到动态链接库的位置

首先 find / -name libboost_system.so.1.65.1 找到文件位置

ad4d15634630f6e87445812c3b0f5e09.png

然后在/etc/ld.so.conf 文件最后添加 /home/dj/lib/boost/lib  即动态库所在目录

/sbin/ldconfig是/etc/ld.so.conf生效

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值