如何在Visual Studio 2003, Visual Studio 2005编译boost 1.34.1?

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,  执行批处理文件

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值