由于在开发C++的程序中使用到正则表达式,用到Boost这个优秀的C++库,记录一下在 VS2008下如何安装和配置boost。
Boost网站www.boost.org下载:boost_1_48_0.zip
- 开始菜单中选择“Visual Studio 2008 命令提示”打开cmd命令框。
- 解压boost_1_48_0.zip文件到“L:\boost_1_48_0”目录,cmd到该目录下运行bootstrap.bat,在“L:\boost_1_48_0”下生成bjam.exe等文件。
- 命令行输入如下内容(以下内容可根据需要更改):
- bjam stage --build-type=complete --stagedir="L:\boost_1_48_0" --with-filesystem --with-thread --with-date_time --with-program_options --layout=versioned threading=multi toolset=msvc-9.0
- bjam stage --build-type=complete --stagedir="L:\boost_1_48_0" --with-regex --layout=versioned threading=multi toolset=msvc-9.0
- bjam --without-python --toolset=msvc-9.0 --prefix=L:\boost_1_48_0 instal
- 参数说明
--without-python 表示不使用 python
--toolset : 所使用编译器,Visual Studio 2008为msvc-9.0
--prefix:编译后library的安装目录
- 在VS2008中配置:
- 工具-选项-项目和解决方案-VC++目录-包含文件下加入:L:\boost_1_48_0
- 工具-选项-项目和解决方案-VC++目录-库文件下加入:L:\boost_1_48_0\lib
参考
http://www.cnblogs.com/xdotnet/archive/2008/03/22/boost_install_config.html
http://blog.youkuaiyun.com/benjiamen/article/details/2643705