flyonok

统计

留言簿(7)

ACE

book

boost

bsd

c study

c++

code download

codeblock

computer clound

Eclipse

embed system

erlang

ET++

gtk

ic card

java

KDE

libevent

linux

linux--MM

mysql

network education

one card

oracle

pcap relation

php

powerbuilder

python

QT

software config

software test

SQL server

UML

wireless

wxwidgets

陈宾

阅读排行榜

评论排行榜

boost 1.35.0 Visual Studio 2008编译指南

一。下载

boost库2008年3月底发布了1.35.0版本,包括了12个新的库和若干对于新库的修正。请参见http://www.boost.org/users/news/version_1_35_0来获取详细的更新信息。

最大的喜讯就是提供了对于Visual Studio 2008编译器的支持(1.34也可以,但是需要手工修改)。

下载地址: 
http://www.boost.org/users/download/

boost JAM可以不用下载,源代码已经包括在boost库中,可以直接来编译出来。

二。准备工作

编译boost库之前,需要做一些准备工作。下载一些Open Source的包,来支持boost特定库的需要。

1. ICU

ICU提供了unicode和国际化支持,目前的版本是3.8.1。ICU的主页是http://www.icu-project.org/

(1). 下载

可以从http://www.icu-project.org/download/3.8.html下载源代码版本和使用VS2005编译的版本。推荐下载源代码版本自己进行编译,以避免依赖于VS2005的运行时库。

(2). 编译

ICU的编译比较简单,打开ICU源代码目录下的sourceallinoneallinone.sln,需要转换到VS2008格式,直接转换即可。然后,选择release,Rebuild Solution即可。

(3). 测试

将编译出来的bin目录加入到系统的PATH目录中去。然后,重新打开allinone.sln工程。

需要通过测试的项目

  1. cintltst项目
  2. intltest项目
  3. iotest

分别设置成启动项目,运行即可。

2. bzip

bzip的主页是 http://www.bzip.org/,从http://www.bzip.org/downloads.html下面下载源代码包即可,boost直接使用源代码来进行编译。

3. zlib

zlib的主页是http://www.zlib.net/,从该网页下面下载源代码包即可,boost直接使用源代码来进行编译。

4. python

python的主页是http://www.python.org/,下载python的2.5.2版本,安装即可。boost默认是会编译python,并且会自动寻找python的安装目录。

三。编译

到开始菜单的VS2008菜单项下,启动Visual Studio 2008 Command Prompt,以下编译步骤均假定直接在该工具下进行编译。

1. 编译Boost.Build

Boost.Build is a text-based system for developing, testing, and installing software. First, you'll need to build and install it. To do this:

  1. Go to the directory tools\build\v2\.
  2. Run bootstrap.bat
  3. Run b2 install --prefix=PREFIX where PREFIX is the directory where you want Boost.Build to be installed
  4. Add PREFIX\bin to your PATH environment variable.

2. 编译boost

鉴于参考2下使用build-type有问题,可以使用以下命令来分别编译dll版本和lib版本。下面是一个示例脚本的例子,其中的目录需要替换:

 1REM used with iostream library 
 2REM boost_1_35_0libsiostreamsdocinstallation.html 
 3
 4set BZIP2_SOURCE="E:libraryzip2-1.0.4" 
 5set ZLIB_SOURCE="E:libraryzlib123" 
 6
 7REM used with regex library with unicode support 
 8set ICU_PATH="E:libraryicu"
 9
10REM DLL版本 
11   
b2 --build-dir=e:\boost-dist toolset=msvc-9.0 --buildtype=complete
--prefix=d:\boost link=shared threading=multi 
runtime-link=shared install
12
13REM lib版本 
14   
  b2 --build-dir=e:\boost-dist toolset=msvc-9.0 --buildtype=complete
--prefix=d:\boost link=static threading=multi 
runtime-link=shared install
四。参考文章

 

1. vs2005下安装boost 
http://hi.baidu.com/vivid217/blog/item/8e484eafd3b52ff8faed5063.html

2. boost1.35.0编译日志 
http://www.cppblog.com/chemz/archive/2008/03/31/45822.html

来自:http://www.cppblog.com/arthurlee/archive/2008/04/07/46427.html

posted on 2011-08-26 11:20 flyonok 阅读(376) 评论(0)  编辑 收藏 引用 所属分类: c++


只有注册用户登录后才能发表评论。
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理