Centos 安装boost库

摘要:
1.在http://www.boost.org/下载boost安装包boost_1_65_1.tar.gz2.在Centos上解压tar-zxvfboost_1_65_1.tar.gz后,cd进入boost_1_65_1目录3.安装boost库到指定目录./b2install--prefix=/home/dj/lib/boost/ 4.如果为了引用方便将目录加到环境变量中在/etc/profile

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 找到文件位置

Centos 安装boost库第1张

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

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

免责声明:文章转载自《Centos 安装boost库》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇layui实现多图上传,支持拖拽上传oracle中去掉回车换行空格的方法详解下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

ubuntu下ldd,查看程序动态库信息

ldd  list, dynamic, dependencies linux-vdso.so.1 => (0x00007ffe9d9b6000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f028c162000) libc....

CentOS 7修改系统时间及硬件时间

在新的centos7里,关于时间的指令除了保留了之前版本中常用到的date、hwclock等命令外,还增加了一个统一的命令timedatactl。下面结合其用法进行下小结。 先看下命令帮助: [root@nginx ~]# timedatectl --help timedatectl [OPTIONS...] COMMAND ... Query or...

QT出现没有MySQL驱动,手动编译步骤

报错代码: "QSqlDatabase: QMYSQL driver not loaded ,QSqlDatabase: available drivers: QSQLITE QODBC QODBC3 QPSQL QPSQL7" 压根就没有QMYSQL,那么就需要我们手动编译,非常简单。 笔者的配置: QT版本 :5.13.0 MySQL数据库是使用的SQ...

自动化部署 jenkins 插件简介

一、什么是持续集成? (1)Continuous integration(CI) 持续集成是一种软件开发实践,即团队开发成员经常集成他们的工作,通常每个成员至少集成一次,也就意味着每天可能会发生多次集成。每次集成都通过自动化的构建(包括编译,发布,自动化测试)来验证,从而尽快地发现集成错误。许多团队发现这个过程可以大大减少集成的问题,让团队能够更快的开发...

Redhat 7及Centos 7系统网卡启动

Redhat 7及Centos 7系统网卡启动: 1.未激活启动:   ifup ifcfg-eth0-------------------------------------------------------------------如果你的网卡是eth0 2.修改网卡为eth0   1)修改 /etc/sysconfig/network-scripts...

CentOS所有版本下载地址分享

简述 CentOS(Community Enterprise Operating System - 社区企业操作系统)是Linux发行版之一,它是来自于Red HatEnterprise Linux依照开放源代码规定释出的源代码所编译而成。由于出自同样的源代码,因此有些要求高度稳定性的服务器以CentOS替代商业版的Red Hat Enterprise L...