[boost c++开源库学习笔记]boost库在Linux下的环境搭建,编译使用 boost_1_54_0版本。

1.下载boost

boost_1_54_0.tar.bz2.

2.boost目录结构

boost_1_54_0/……………..Boost的根目录

index.htm………boost的讲解文档,可以离线看。和官网的文档一样。

boost/…………………….所有boost的头文件

libs/…………Tests, .cpps, docs, etc., by library一些测试c++文档,,说明文档等等。具体还不清楚

index.html……..库说明文档在此

algorithm/

any/

array/…more libraries…等等

status/…………………….Boost-wide test suite

tools/………..Utilities, e.g. Boost.Build, quickbook, bcp

more/……………………..Policy documents, etc.

doc/……………boost库说明文档,可以不用管。

图1.Boost文件目录

3.使用boost头文件4.只需要使用头文件的库

使用boost库并不是所有的库都需要编译。只要程序引入头文件就OK。

举出反例,下列库是需要单独编译的。

而有些库可以选择是否单独编译

Boost.Exceptionprovides non-intrusive implementation of exception_ptr for 32-bit _MSC_VER==1310 and _MSC_VER==1400 which requires a separately-compiled binary. This is enabled by #define BOOST_ENABLE_NON_INTRUSIVE_EXCEPTION_PTR.5.简单的使用boost库的一个例子

*输出为输入数字的三倍#include <boost/lambda/lambda.hpp> 5 #include <iostream> 6 #include <iterator> 7 #include <algorithm> 8 int main() 9 { boost::lambda;11typedef std::istream_iterator<int> in;12 13 std::for_each( );15 }没有什么可留恋,只有抑制不住的梦想,

[boost c++开源库学习笔记]boost库在Linux下的环境搭建,编译使用 boost_1_54_0版本。

相关文章:

你感兴趣的文章:

标签云: