Chinaunix首页 | 论坛 | 博客
  • 博客访问: 583840
  • 博文数量: 69
  • 博客积分: 2204
  • 博客等级: 大尉
  • 技术积分: 808
  • 用 户 组: 普通用户
  • 注册时间: 2009-10-11 22:37
个人简介

..微笑着看着杯中的花茶一片片撑开.. ..透明的花瓣里水破开的声音很轻微..

文章分类

全部博文(69)

文章存档

2018年(1)

2017年(2)

2016年(10)

2015年(8)

2014年(6)

2013年(6)

2012年(4)

2011年(8)

2010年(12)

2009年(12)

分类: C/C++

2011-04-07 16:31:18

boost版本1.45.0

0、记MinGW的安装文件夹是MINGW-INST (本人机器上在C:\Development\MinGW\);记boost安装到文件夹BOOST-INST下(本人机器上是C:\Development\boost\1.45.0\)

1、解压下载包到某个文件夹,记该文件夹为BOOST-DIST(本人机器上在D:\Development_Tools\boost_1_45_0\);

2、打开cmd,进入BOOST-DIST;

3、编译bjam
   3.1、进入bjam的源文件夹BOOST-DIST\tools\build\v2\engine\src
   3.2、输入命令 build gcc --toolset-root=MINGW-INST\bin
   3.3、生成的bjam.exe在BOOST-DIST\tools\build\v2\engine\src\bin.ntx86下,将其复制到BOOST-DIST下
注:如果观察BOOST-DIST\tools\build\v2\engine\src下build.bat文件可以发现,不输入参数时默认选择的toolset是微软c++编译器,见下面的build.bat代码

:Guess_Toolset  #说明当不输入参数给build.bat时,脚本将按下面代码的顺序猜一个toolset
REM Try and guess the toolset to bootstrap the build with...
REM Sets BOOST_JAM_TOOLSET to the first found toolset.
REM May also set BOOST_JAM_TOOLSET_ROOT to the
REM location of the found toolset.

call :Clear_Error
call :Test_Empty %ProgramFiles%
if not errorlevel 1 set ProgramFiles=C:\Program Files

call :Clear_Error
if NOT "_%VS100COMNTOOLS%_" == "__" (
    set "BOOST_JAM_TOOLSET=vc10"
    set "BOOST_JAM_TOOLSET_ROOT=%VS100COMNTOOLS%..\..\VC\"
    goto :eof)
call :Clear_Error
......
......
if EXIST "C:\Development\MinGW\bin\gcc.exe" (
    set "BOOST_JAM_TOOLSET=mingw"
    set "BOOST_JAM_TOOLSET_ROOT=C:\MinGW\" #如果MinGW安装在默认目录下且没有装任何版本的VC,则应该能猜中
    goto :eof)
call :Clear_Error
......

4、编译boost
   4.1、bjam --help可查看bjam的可用参数;bjam --show-libraries显示可以编译安装的boost包(本人安装random、graph、graph_parallel和date_time)
   4.2、输入命令 bjam stage toolset=gcc --build-dir=build --build-type=complete --with-date_time --with-graph --with-graph_parallel  --with-random;

5、安装boost 输入命令bjam install toolset=gcc --prefix=BOOST-INST --with-date_time --with-graph --with-graph_parallel  --with-random。

阅读(3122) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~