1.下载boost source
到http://www.boost.org下载最新版本的boost,我目前下载的是1.34.1,将之解压到c:/boost_1_34_1/
2.编译bjam
C:/boost_1_34_1/tools/jam/src下,执行build.bat,然后会在C:/boost_1_34_1/tools/jam/src/bin.ntx86/生成一个bjam.exe,将bjam.exe复制到c:/boost_1_34_1/下。
3.设定编译环境
修改user-config.jam (C:/boost_1_34_1/tools/build/v2/user-config.jam) 的MSVC configuration
A:vs2003.net
using msvc :
7.1
;
B:vs2005.net
using msvc :
8.0
: : <compileflags>/wd4819 <compileflags>/D_CRT_SECURE_NO_DEPRECATE <compileflags>/D_SCL_SECURE_NO_DEPRECATE <compileflags>/D_SECURE_SCL
=
0
;
在VC8.0出现的warning,主要是以下2类
a.C4819 : 代码中cp950无法显示的字元.
b.VC8.0特有的的safe_code技术.
宏解释:
_CRT_SECURE_NO_DEPRECATE和_SCL_SECURE_NO_DEPRECATE用于关闭safe code代码警告, _SECURE_SCL用于控制是否用safe code对STL边界进行检查。
C: 加上 python , 目前我用的是2.5版
using
python :
2.5
;
4:下载bzip2-1.0.4 zlib-1.2.3, icu4c-3.6:
bzip2-1.0.4 下载:http://www.bzip.org/
zlib-1.2.3 下载: http://www.zlib.net/
icu4c-3.6 下载: http://www.icu-project.org/
5:下载python2.5 , 安装到c:/
python2.5 下载: http://www.python.org/
6:写一个批处理文件,内容是:
SET BZIP2_SOURCE
=
"
D:/bzip2-1.0.4
"
SET ZLIB_SOURCE
=
"
D:/zlib-1.2.3
"
SET ICU_PATH
=
"
D:/icu4c-3.6
"
bjam
--
toolset
=
msvc
-
8.0
--
stagedir
=
.
/
lib_x86
--
builddir
=
.
/
address
-
model
=
32
link
=
static
runtime
-
link
=
static
threading
=
multi stage debug release
bjam
--
toolset
=
msvc
-
8.0
--
stagedir
=
.
/
lib_x64
--
builddir
=
.
/
address
-
model
=
64
link
=
static
runtime
-
link
=
static
threading
=
multi stage debug release
或
SET BZIP2_SOURCE
=
"
D:/bzip2-1.0.4
"
SET ZLIB_SOURCE
=
"
D:/zlib-1.2.3
"
SET ICU_PATH
=
"
D:/icu4c-3.6
"
bjam
--
toolset
=
msvc
-
8.0
--
stagedir
=
.
/
lib_x86
--
builddir
=
.
/
address
-
model
=
32
link
=
shared runtime
-
link
=
shared threading
=
multi stage debug release
bjam
--
toolset
=
msvc
-
8.0
--
stagedir
=
.
/
lib_x64
--
builddir
=
.
/
address
-
model
=
64
link
=
shared runtime
-
link
=
shared threading
=
multi stage debug release
7.将批处理文件放到C:/boost_1_34_1, 执行批处理文件