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.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编译安装(可以完全安装,也可定制安装--buildtype=complete,link=static)的更多相关文章
- boost1.59编译安装
boost 1.59.0编译及使用 1.下载: 网址:http://sourceforge.net/projects/boost/files/boost/1.59.0/ 选择: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 ...
- 32位win7+vs2008编译mysql 5.6.22源码并安装
以下这部分安装说明是来自http://www.2cto.com/database/201407/316681.html的win7+vs2010源码编译mysql,文章最后会说明用vs2008编译遇见的 ...
- win10下通过编译源码方式在chrome中成功安装react-devtools开发工具插件
win10下通过编译源码方式在chrome中成功安装react-devtools开发工具插件 1.去git上下载react-devtools文件到本地,https://github.com/fac ...
- Ubuntu16.04 安装Tensorflow1.7过程记录一:安装显卡驱动
为刚到手的Titan V装新系统,首先当然是显卡驱动安装. 可以参考这:https://jingyan.baidu.com/article/d7130635c5a86113fdf47532.html ...
- 三、安装cmake,安装resin ,tars服务,mysql 安装介绍,安装jdk,安装maven,c++ 开发环境安装
三.安装cmake,安装resin 2018年07月01日 21:32:05 youz1976 阅读数:308 开发环境说明: centos7.2 ,最低配置:1核cpu,2G内存,1M带宽 1. ...
- Linux安装软件总结(二.几种安装命令介绍)
一.rpm包安装方式步骤: 1.找到相应的软件包,比如soft.version.rpm,下载到本机某个目录: 2.打开一个终端,su -成root用户: 3.cd soft.version.rpm所在 ...
- Inno setup定制安装界面
Innosetup功能很强大,可以通过它提供的Wizard接口来定制界面,但我对PASCAL语言不熟悉,也不清楚通过那种接口可改动的范围有多大,最后做出来的效果是否好,所以选择了通过一个DLL来实现我 ...
- Wix 安装部署教程(九) --用WPF做安装界面
经常安装PC端的应用,特别是重装系统之后,大致分为两类.一类像QQ,搜狗输入法这样的.分三步走的:第一个页面可以自定义安装路径和软件许可.第二个页面显示安装进度条,第三个页面推荐其他应用.先不管人家怎 ...
随机推荐
- PythonNET网络编程3
IO IO input output 在内存中存在数据交换的操作都可以认为是IO操作 和终端交互 : input print 和磁盘交互 : read write 和网络交互 : recv send ...
- GO语言学习(十六)Go 语言结构体
Go 语言结构体 Go 语言中数组可以存储同一类型的数据,但在结构体中我们可以为不同项定义不同的数据类型. 结构体是由一系列具有相同类型或不同类型的数据构成的数据集合. 结构体表示一项记录,比如保存图 ...
- WebService学习总结(5)——WebService常见开发框架比较
在SOA领域,我们认为Web Service是SOA体系的构建单元(building block).对于服务开发人员来说,AXIS和CXF一定都不会陌生.这两个产品都是Apache孵化器下面的Web ...
- Android 使用XML隐藏ActionBar中遇错的解决的方法
今天我在使用Menifest.xml让程序隐藏标题栏是一直出错.主要内容是: You need to use a theme.AppCompat theme(descendant) with this ...
- Qt5 UI信号、槽自动连接的控件重名大坑(UI生成的槽函数存在一个隐患,即控件重名。对很复杂的控件,不要在 designer 里做提升,而是等到程序启动后,再动态创建,可以避免很多问题)
对Qt5稍有熟悉的童鞋都知道信号.槽的自动连接机制.该机制使得qt designer 设计的UI中包含的控件,可以不通过显式connect,直接和cpp中的相应槽相关联.该机制的详细文章见 http: ...
- Android Java Mail与Apache Mail发送邮件对比
原文链接: 一.邮件简介 一封邮件由很多信息构成,主要的信息如下,其他的暂时不考虑,例如抄送等: 1.收件人:收件人的邮箱地址,例如xxx@xx.com 2.收件人姓名:大部分的邮件显示时都会显 ...
- TOP全异步模式
Top全异步方式调用技术方案 背景:目前top通过servlet3.0技术结合异步管道化框架做到半异步调用,半异步调用采用异步线程同步调用后端的方式来做api call @飞不起的奥特曼 的部分文档) ...
- mysql 5.7 innodb count count(*) count(1) 大数据 查询慢 耗时多 优化
原文:mysql 5.7 innodb count count(*) count(1) 大数据 查询慢 耗时多 优化 问题描述 mysql 5.7 innodb 引擎 使用以下几种方法进行统计效率差不 ...
- vue项目build后font-awesome不显示问题
解决办法: 修改build目录下的utils.js:添加 publicPath: '../../' // Extract CSS when that option is specified // (w ...
- ZOJ 3204 Connect them 继续MST
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=3367 题目大意: 让你求最小生成树,并且按照字典序输出哪些点连接.无解输出-1 ...