一. PC编译安装boost

boost是C++的准标准库,其有两种安装方法。

1. ubuntu下,通过sudo apt-get install libboost-all-dev。

2. 通过源码包安装,http://sourceforge.net/projects/boost/files/latest/download?source=dlp

下载源码包:boost_1_57_0.tar.bz2

1)解压后,进入目录,配置编译环境

./bootstrap.sh

注:boost下头文件在目录boost下。

2) 编译

./b2

编译完成后,stage下是生成的库文件。

3) 安装到主机上

sudo ./b2 install

默认安装头文件/usr/local/include/boost目录下,库文件在/usr/local/lib目录下。

二. ARM交叉编译boost

1)解压后,进入目录,配置编译环境,同PC。

./bootstrap.sh

注:boost下头文件在目录boost下。

2) 编译

    编译前需配置交叉编译器,

if ! gcc in [ feature.values <toolset> ]

{

#关键是以下这句的修改

using gcc : arm : arm-linux-g++ ;

#另外生成目录或者放置编译结果的目录请自行另作选择

}

./b2

编译完成后,stage下是生成的库文件。

gcc.compile.c++ bin.v2/libs/wave/build/gcc-arm/release/link-static/threading-multi/token_ids.o
gcc.compile.c++ bin.v2/libs/wave/build/gcc-arm/release/link-static/threading-multi/wave_config_constant.o
common.mkdir bin.v2/libs/wave/build/gcc-arm/release/link-static/threading-multi/cpplexer
common.mkdir bin.v2/libs/wave/build/gcc-arm/release/link-static/threading-multi/cpplexer/re2clex
gcc.compile.c++ bin.v2/libs/wave/build/gcc-arm/release/link-static/threading-multi/cpplexer/re2clex/aq.o
gcc.compile.c++ bin.v2/libs/wave/build/gcc-arm/release/link-static/threading-multi/cpplexer/re2clex/cpp_re.o
gcc.archive bin.v2/libs/wave/build/gcc-arm/release/link-static/threading-multi/libboost_wave.a
common.copy stage/lib/libboost_wave.a
...failed updating targets...
...skipped targets...
...updated targets...

一般情况下,有些库编译不成功,编译完成的库都在stage/lib下。

3) 安装到主机上

创建目录/usr/arm,/usr/arm/include,/usr/arm/lib;将boost/这个目录拷贝至/usr/arm/include下,将stage/lib下的库文件拷贝至/usr/arm/lib下。

默认安装头文件/usr/local/include/boost目录下,库文件在/usr/local/lib目录下。

三. 编译个小程序验证下是否成功。

#cat test.cpp
#include <boost/lexical_cast.hpp>
#include <iostream> int main()
{
using boost::lexical_cast;
int a= lexical_cast<int>("");
double b = lexical_cast<double>("123.456");
std::cout << a << std::endl;
std::cout << b << std::endl;
return ;
}
g++ -o test test.cpp
#ls
test test.cpp
# ./test 123.456

参考:

http://www.xitongzhijia.net/xtjc/20150407/44268.html

http://blog.csdn.net/jwybobo2007/article/details/7242307

http://blog.csdn.net/jwybobo2007/article/details/8850008

boost 1.57.0安装的更多相关文章

  1. [Boost] 1.57.0 with VS2013 + Intel compiler

    The compiled version can be found below. Do not foget to give me a star. :) http://pan.baidu.com/s/1 ...

  2. VS2010编译Boost 1.57 静态链接库

    http://www.cnblogs.com/cuish/p/4175491.html 0.前提 Boost库版本 1.57.0 下载地址 http://www.boost.org/users/his ...

  3. boost 1.56.0 编译及使用

    boost的编译和使用,经过搜集资料和总结,记录成文.感谢文后所列参考资料的作者. 1 下载 地址:http://sourceforge.net/projects/boost/files/boost/ ...

  4. CENTOS6.6下mysql5.7.11带boost和不带boost的源码安装

    本文来自我的github pages博客http://galengao.github.io/ 即www.gaohuirong.cn Mysql5.7版本更新后有很多变化,比如json等,连安装都有变化 ...

  5. boost的下载和安装(windows版)

    1 简介 boost是一个准C++标准库,相当于STL的延续和扩充,它的设计理念和STL比较接近,都是利用泛型让复用达到最大化. boost主要包含以下几个大类: 字符串及文本处理.容器.迭代器(it ...

  6. ubuntu14.04 boost 1.58.0 安裝

    1.首先下载安装包,然后解压, 切换目录 wget -o boost_1_58_0.gar.gz http://sourceforge.net/projects/boost/files/boost/1 ...

  7. Mysql依赖库Boost的源码安装,linux下boost库的安装

      boost‘准标准库’安装过程.安装的是boost_1_60_0. (1)首先去下载最新的boost代码包,网址www.boost.org. (2)进入到自己的目录,解压: bzip2 -d bo ...

  8. boost 学习笔记 0: 安装环境

    boost 学习笔记 0: 安装环境 最完整的教程 http://einverne.github.io/post/2015/12/boost-learning-note-0.html Linux 自动 ...

  9. 【linux】【jdk】jdk8.0安装

    系统环境:Centos7 一.下载jdk8.0 jdk官方网站:https://www.oracle.com/technetwork/java/javase/downloads/jdk8-downlo ...

随机推荐

  1. [转].net自定义configSections的5个示例

    本文转自:http://www.yongfa365.com/item/configuration-configSections-SingleTagSectionHandler-DictionarySe ...

  2. PHP 错误与异常 笔记与总结(16 )自定义异常处理器

    可以使用自定义异常处理器来处理所有未捕获的异常(没有用 try/catch 捕获的异常). set_exception_handler():设置一个用户定义的异常处理函数,当一个未捕获的异常发生时所调 ...

  3. Redis 笔记与总结5 Redis 常用命令之 键值命令 和 服务器命令 && 高级应用之 安全性 和 主从复制

    Redis 提供了丰富的命令对数据库和各种数据库类型进行操作,这些命令可以在 Linux 终端使用. 1. 键值相关命令: 2. 服务器相关命令 键值相关命令 ① keys 命令 返回满足给定 pat ...

  4. Yii源码阅读笔记(十一)

    controller类的render部分,用于渲染视图和布局文件: /** * Returns all ancestor modules of this controller. * 获取当前控制器所有 ...

  5. HTML: margin詳解

    margin:10px; 設置塊元素的上,右,下,左方向的值同爲10px margin:10px 30px; 設置塊元素的上和下爲10px,左和右爲30px; margin:10px 20px 30p ...

  6. Latex使用

    tex是一种文本格式化程序语言,通过使用各种命令,对文本进行排版定义,最后通过编译,生成美观的排版完毕的文档. 同html.css的组合很想,定义元素以及元素的显示属性,按照编写好的文本格式化内容,在 ...

  7. VS编程中找不到Microsoft.Office.Core、Microsoft.Office.Interop.Word和VBIDE

    在使用vs2005. vs2008. vs2010 制作包含 word等office的应用程序时,有时找不到对Microsoft.Office.Core. Microsoft.Office.Inter ...

  8. buffer overflow vulnerabilitie

    Computer Systems A Programmer's Perspective Second Edition Avoiding security holes.For many years,bu ...

  9. AES加密时抛出 Illegal key size or default parameters

    使用AES加密时,当密钥大于128时,代码会抛出java.security.InvalidKeyException: Illegal key size or default parameters Il ...

  10. SVN提交注意点

    一.提交之前先更新 1.         SVN更新的原则是要随时更新,随时提交.当完成了一个小功能,能够通过编译并且自己测试之后,谨慎地提交. 2.         如果在修改的期间别人也更改了sv ...