boost1.59编译安装
boost 1.59.0编译及使用
1、下载:
网址:http://sourceforge.net/projects/boost/files/boost/1.59.0/
选择:boost_1_59_0.7z或者boost_1_59_0.zip (Windows 8.1企业版操作系统);
boost_1_59_0.tar.bz2 ( Linux内核操作系统——Ubuntu 14.04(编译器使用自带的GCC 4.8.2))。
2、编译:
- 2.1 Ubuntu 14.04操作系统编译安装boost 1.59.0:
2.1.1 快速安装Boost:
在Linux内核的操作系统下安装boost 1.59.0很容易,最简单的方式是在Boost解压缩后的目录下直接执行命令:
./bootstrap.sh ./b2 install
第一条命令语句booststrap.sh是编译前的配置工作,第二条命令b2开始真正的编译并安装Boost。由于未指定额外选项,Boost将编译Release版本的库文件,把头文件安装到/usr/local/include,库文件安装到/usr/local/lib。
2.1.2 完整安装Boost:
完整编译Boost,使用buildtype选项指定编译类型(如不指定默认使用release模式),在bootstrap.sh之后执行如下命令:
./b2 --buildtype=complete install
这样将开始对Boost的完整编译,安装所有调试版、发行版的静态库和动态库。
2.1.3 定制安装Boost:
完整编译Boost费时费力,在实际开发中这些库也不会都用到,因此,Boost也允许用户自行选择要编译的库。执行命令:
./b2 --show-libraries
可查看所有必须编译才能使用的库。
在完全编译的基础上,可使用--with或者--without选项打开或者关闭某个库的编译,如:
./b2 --with-date_time --buildtype=complete install
将仅编译安装date_time库。
一般可使用如下安装命令:
sudo ./b2 link=static install #编译安装所有静态库
- 2.2 Windows 8.1操作系统安装配置boost 1.59.0:
直接在官网:http://sourceforge.net/projects/boost/files/boost-binaries/1.59.0/ ,下载:boost_1_59_0-msvc-12.0-64.exe,然后解压配置即可。
boost_1_59_0-msvc-12.0-64.exe Visual Studio 2013 64位版本的boost库。
error 解决:
一:使用需要python库
否则出现如下error:
./boost/python/detail/wrap_python.hpp:50:23: fatal error: pyconfig.h: No such file or directory
compilation terminated.
"g++" -ftemplate-depth-128 -O3 -finline-functions -Wno-inline -Wall -march=i686 -pthread -fPIC -m32 -DBOOST_ALL_NO_LIB=1 -DBOOST_PYTHON_SOURCE -DNDEBUG -I"." -I"/usr/include/python2.7" -c -o "bin.v2/libs/python/build/gcc-5.4.0/release/threading-multi/object/function_doc_signature.o" "libs/python/src/object/function_doc_signature.cpp"
...failed gcc.compile.c++ bin.v2/libs/python/build/gcc-5.4.0/release/threading-multi/object/function_doc_signature.o...
..failed updating 58 targets...
...skipped 12 targets...
...updated 11810 targets...
使用
sudo apt-get install python-dev
bzlib.h: No such file or directory
理论上,本文适用于boost的各个版本,尤其是最新版本1.48.0;适用于各种C++编译器,如VC6.0(部分库不支持),VS2003,VS2005,VS2008,VS2010,gcc,C++ Builder等。
1.下载boost源文件
http://www.boost.org/users/download/
2.安装
cd /home/boost_1_48_0/
首先需要编译bjam: ./bootstrap.sh --prefix=/home/boost-1.48.0/sdk/ 设置库安装路径
通过bjam编码boost库: ./bjam install
3.设置环境变量
在/etc/profile.d新建可执行文件boost.sh,添加文件内容:
#!/bin/sh
BOOST_INCLUDE=/home/boost-1.48.0/sdk/include/boost
BOOST_LIB==/home/boost-1.48.0/sdk/lib
export BOOST_INCLUDE BOOST_LIB
命令行执行:source /etc/profile.d/boost.sh
以后在编译程序时,只需要用:-I$BOOST_INCLUDE -L$BOOST_LIB 即可,还要使用-l指定了链接库。
然后, /etc/ld.so.conf 文件添加so库的环境变量 /home/boost-1.48.0/sdk/lib(主要关键问题)
修改完成后,通过ldconfig命令进行重启
4.遇到的问题及解决方案
安装过程出现很多和bz及Python库相关的错误,解决方案如下
命令方式
sudo apt-get install libbz2-dev yum install python-dev或
yum install libbz2-dev yum install python-dev
图像界面方式
点击Applications---->Add/Remove Software 去安装这个包文件
PS 安装过程中的错误:
libs/iostreams/src/bzip2.cpp:20:56: error: bzlib.h: 没有那个文件或目录
libs/iostreams/src/bzip2.cpp:31: error: ‘BZ_OK’ was not declared in this scope
libs/iostreams/src/bzip2.cpp:32: error: ‘BZ_RUN_OK’ was not declared in this scope
libs/iostreams/src/bzip2.cpp:33: error: ‘BZ_FLUSH_OK’ was not declared in this scope
libs/iostreams/src/bzip2.cpp:34: error: ‘BZ_FINISH_OK’ was not declared in this scope
libs/iostreams/src/bzip2.cpp:35: error: ‘BZ_STREAM_END’ was not declared in this scope
libs/iostreams/src/bzip2.cpp:36: error: ‘BZ_SEQUENCE_ERROR’ was not declared in this scope
libs/iostreams/src/bzip2.cpp:37: error: ‘BZ_PARAM_ERROR’ was not declared in this scope
libs/iostreams/src/bzip2.cpp:38: error: ‘BZ_MEM_ERROR’ was not declared in this scope
libs/iostreams/src/bzip2.cpp:39: error: ‘BZ_DATA_ERROR’ was not declared in this scope
libs/iostreams/src/bzip2.cpp:40: error: ‘BZ_DATA_ERROR_MAGIC’ was not declared in this scope
libs/iostreams/src/bzip2.cpp:41: error: ‘BZ_IO_ERROR’ was not declared in this scope
libs/iostreams/src/bzip2.cpp:42: error: ‘BZ_UNEXPECTED_EOF’ was not declared in this scope
libs/iostreams/src/bzip2.cpp:43: error: ‘BZ_OUTBUFF_FULL’ was not declared in this scope
libs/iostreams/src/bzip2.cpp:44: error: ‘BZ_CONFIG_ERROR’ was not declared in this scope
libs/iostreams/src/bzip2.cpp:48: error: ‘BZ_FINISH’ was not declared in this scope
//mostly like above....
./boost/python/detail/wrap_python.hpp:50:23: error: pyconfig.h: No such file or directory
./boost/python/detail/wrap_python.hpp:75:24: error: patchlevel.h: No such file or directory
./boost/python/detail/wrap_python.hpp:78:2: error: #error Python 2.2 or higher is required for this version of Boost.Python.
./boost/python/detail/wrap_python.hpp:142:21: error: Python.h: No such file or directory
./boost/python/instance_holder.hpp:34: error: ‘PyObject’ has not been declared
./boost/python/instance_holder.hpp:41: error: expected ‘;’ before ‘(’ token
./boost/python/instance_holder.hpp:45: error: ‘PyObject’ has not been declared
./boost/python/detail/wrapper_base.hpp:21: error: expected initializer before ‘*’ token
./boost/python/detail/wrapper_base.hpp:23: error: expected initializer before ‘*’ token
./boost/python/detail/wrapper_base.hpp:30: error: expected initializer before ‘*’ token
./boost/python/detail/wrapper_base.hpp:34: error: expected initializer before ‘*’ token
./boost/python/detail/wrapper_base.hpp:43: error: ‘PyObject’ has not been declared
./boost/python/detail/wrapper_base.hpp:44: error: ISO C++ forbids declaration of ‘PyObject’ with no type
./boost/python/detail/wrapper_base.hpp:44: error: ‘PyObject’ is neither function nor member function; cannot be declared friend
windows下编译安装boost.
先生成bjam,要在vs附带的命令行下执行才可以,在cmd下运行bat可能会卡主不动
bjam stage --toolset=msvc-9.0 --without-graph --without-graph_parallel --without-math --without-mpi --without-python --without-serialization --without-wave --stagedir="E:\boost_1_49" link=static runtime-link=static threading=multi debug release
默认为32位版本,编译成64位:
bjam stage --toolset=msvc-9.0 --without-graph --without-graph_parallel --without-math --without-mpi --without-python --without-serialization --without-wave --stagedir="E:\boost_1_49_new" link=static runtime-link=static threading=multi address-model=64 debug release
- 顶
boost1.59编译安装的更多相关文章
- boost1.59编译安装(可以完全安装,也可定制安装--buildtype=complete,link=static)
1.下载: 网址:http://sourceforge.net/projects/boost/files/boost/1.59.0/ 选择:boost_1_59_0.7z或者boost_1_59_0. ...
- Win10 VS2013 PCL1.8.1和依赖项VTK8.0.1, QHuall(2.15.2), FLANN1.9.1,Boost1.59.0,Zbil1.2.11和libPNG1.6.34编译安装
编译和安装过程最好使用管理员权限去操作,避免不必要的错误. 一般而言为了区分Debug和Release库,添加输入变量 Name: CMAKE_DEBUG_POSTFIX Type: STRING V ...
- CentOS 6 多实例 编译安装mariadb-5.5.59
系统平台: CentOS release 6.9 (Final) 内核 2.6.32-696.el6.x86_64 1.去官网下载适合的源码包 http://mariadb.org/ mariadb- ...
- CentOS 7 源码编译安装MySQL 5.7.14
一.添加用户和组 1. 进入root: su 2. 添加组: groupadd mysql 3. 添加用户: useradd -r -g mysql -s /bin/false mysql 二.安装 ...
- LINUX下编译安装PHP各种报错大集合
本文为大家整理汇总了一些linux下编译安装php各种报错大集合 ,感兴趣的同学参考下. nginx1.6.2-mysql5.5.32二进制,php安装报错解决: 123456 [root@clien ...
- centos 7.0 编译安装php 5.6.7
编译安装php参考资料 MySQL PHP API http://dev.mysql.com/doc/apis-php/en/index.html nginx + php +mysql 最简单安装 官 ...
- Ubuntu 14.04 编译安装 husky
简介 Husky是一个大数据分布式开发框架,用C++开发,因为粗粒度(coarse-grained)平台(如Spark,Hadoop,Flink)MR耗时太大,然后细粒度(fine-grained)平 ...
- CentOS 7.2.1511编译安装Nginx1.10.1+MySQL5.7.14+PHP7.0.11
准备篇 一.防火墙配置 CentOS 7.x默认使用的是firewall作为防火墙,这里改为iptables防火墙. 1.关闭firewall: systemctl stop firewalld.se ...
- CentOS 6.2编译安装Nginx1.2.0+MySQL5.5.25+PHP5.3.13
CentOS 6.2编译安装Nginx1.2.0+MySQL5.5.25+PHP5.3.132013-10-24 15:31:12标签:服务器 防火墙 file 配置文件 written 一.配置好I ...
随机推荐
- H.264 详解
一.MPEG-4说明 1.VOP视频编码技术 VO(Video Object):视频对象,它是场景中的某个物体,最简单的情况下就是矩形框,它是有生命期的,由时间上连续的许多帧构成. VOP(Video ...
- ython实现进程间的通信有Queue,Pipe,Value+Array等,其中Queue实现多个进程间的通信,而Pipe实现两个进程间通信,而Value+Array使用得是共享内存映射文件的方式,所以速度比较快
1.Queue的使用 from multiprocessing import Queue,Process import os,time,random #添加数据函数 def proc_write(qu ...
- 关于spring中AOP的几件小事
0.AOP简介 AOP(Aspect-Oriented Programming,面向切面编程):是一种新的方法论,是穿透OOP的补充. AOP的主要编程对象是切面(aspect),而切面模块化横切关注 ...
- c语言测试芯片好坏
问题描述有n个(2<n<20)芯片,好的或坏的,并且有比坏的芯片更多的已知的好的芯片.每个芯片都可以用来测试其他芯片.当用一个好的芯片测试其他芯片时,它可以正确地给出被测芯片是好是坏.当用 ...
- python 列表字典按照字典中某个valu属性进行排序
对用户名进行排序 1. 直接上代码 base_dn_list = [ {', 'tenant': 'HAD', 'role': {'roleID': 'project', 'roleName': '项 ...
- Tomcat面试题汇总
详见:Tomcat 面试题汇总:https://blog.csdn.net/qq_25934401/article/details/81536958 1.Tomcat的缺省端口是多少,怎么修改? to ...
- linux安装RabbitMQ yum
一.RabbitMQ概念RabbitMQ是流行的开源消息队列系统,是AMQP(Advanced Message Queuing Protocol高级消息队列协议)的标准实现,用erlang语言开发 ...
- Mount Windows (CIFS) shares on Linux with credentials in a secure way
Posted on 09/09/2014 In almost all cases, when mounting a CIFS-share on a Linux host, you will nee ...
- [Nginx]子目录反向代理kibana并添加basic认证
背景 服务器ip:192.168.1.2 安装软件 nginx kibana(默认端口5601) 实现方案:访问http://192.168.1.2/kibana 即可访问到kibana后端,同时需要 ...
- 第八章 watch监听 83 名称案例-使用watch监听文本框数据的变化
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8&quo ...