boost1_55_0编译和安装

1、在www.boost.org下载文件并解压

2、进行解压目录

    2.1 编译前的配置工作

    执行bootstrap.bat  windows

    使用vs2010:

              修改oost_1_55_0 oolsuildv2user-config.jam文件,

             # Configure specific msvc version (searched for in standard locations and PATH).
             # using msvc : 8.0 ;
              using msvc : 10.0 ; //新增加的

    使用CodeBlocks自带的MinGW编译器:

           1、先把编译所在路径加入到环境变量中,如我本机为D:Program Files (x86)CodeBlocksMinGWin

           2、新打开cmd窗口,输入gcc -v查看gcc的版本。成功显示说明加入环境变量成功,可以进行编译。

           3、 修改oost_1_55_0 oolsuildv2user-config.jam文件,

                # Configure gcc (default version).
                using gcc ;    //去掉前面的#表示启用

    执行./bootstrap.sh  linux

     2.2 编译

     b2.exe --buildtype=complete stage windows

     ./b2 --buildtype=complete stage linux

     2.3  可以选择库进行编译

     b2 --show-libraries,可查看所有必须编译才能使用的库

     b2 --with-date_time --with-thread --buildtype=complete stage 只编译date_time 和thread库

3、引用相头的库即可使用。按步骤2.3进行编译的话生成库存放位置在boost_1_55_0stagelib下面。

install                 Install headers and compiled library files to the  configured locations (below).
#
#   --prefix=<PREFIX>       Install architecture independent files here.
#                           Default; C:Boost on Win32
#                           Default; /usr/local on Unix. Linux, etc.

stage                   Build and install only compiled library files  to the stage directory.
#
#   --stagedir=<STAGEDIR>   Install library files here
#                           Default; ./stage

    

原文地址:https://www.cnblogs.com/zxpo/p/3535554.html