Wednesday, April 22, 2009

boost_1_38_0编译过程

boost是一个完全符合C++规范的代码库,
web site: http://www.boost.org/
编译过程如下:
一.Window环境
1. 运行cmd
2. cd boost_1_38_0\tools\jam\src @进入jam源码目录
3. build.dat vc8 @针对VS2005编译
4. copy bin.ntx86\bjam.exe ..\..\.. @将bjam文件拷贝到顶层目录下
5. cd ..\..\.. @回到顶层目录
6. bjam.exe --build-dir=.\build --toolset=msvc-8.0 stage
更详细的编译参数可参考boost_1_38_0/more/getting_started/windows.html
二.Linux环境
1. cd ~/share/boost_1_38_0 #进入boost源码目录
2. cd tools/jam/src/ #进入jam源码目录
3. ./build.sh gcc #在当前目录下的bin.linuxx86生成bjam文件
4. cp ./bin.linuxx86/bjam ../../../ #将bjam文件拷贝到顶层目录下
5. cd ../../.. #回到顶层目录
6. ./bjam --build-dir=$PWD/build --toolset=gcc --build-type=release stage #生成的库文件存放在boost_1_38_0/stage/lib/目录下
更详细的编译参数可参考boost_1_38_0/more/getting_started/unix-variants.html

测试环境:
Windows XP Professional SP2 & VS2005
VMware 5.5.1 & Ubuntu 8.10 & gcc4.3.2

No comments:

Post a Comment