boost在windows下的编译,开发

以使用vs2008的编译器进行编译为例。
 
(1)安装好vs2008后,在环境变量path中加入D:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin,使得编译时可以找到vs的编译器cl.exe
 
(2)开始-->所有程序-->Microsoft Visual Studio 2008-->Visual Studio tools-->Visual Studio 2008 command prompt, 进入命令行。(相当于设置好vs相关环境变量的cmd.exe)
 
(3)cd到D:\boost_1_49_0下执行bootstrap.bat,
 
(4)执行b2.exe编译, (也可以用bjam.exe加很多参数来进行操作,网上好多都是这么干的,b2可能是默认安装)
安装成功后,会出现:

The Boost C++ Libraries were successfully built! 

The following directory should be added to compiler include paths:

    D:/boost_1_49_0

The following directory should be added to linker library paths:

    D:\boost_1_49_0\stage\lib
告诉你头文件的路径为D:/boost_1_49_0, 链接库的路径为 D:\boost_1_49_0\stage\lib
 
(5) 使用vs编写boost程序,在vs的工具-->选项-->vc++目录-->(右边)显示以下内容的目录,选择包含文件,添加D:/boost_1_49_0;然后选择库文件,添加D:\boost_1_49_0\stage\lib
 
(6) 新建项目,win32控制台程序,在下一步的某个选项中选择空项目
 
一个boost简单介绍http://zh.highscore.de/cpp/boost/
 
2012年6月2日,星期六
 





posted @ 2012-06-02 18:02  clb  阅读(209)  评论(0编辑  收藏  举报