﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>C++博客-Jiwu Bu-随笔分类-Boost</title><link>http://www.cppblog.com/bujiwu/category/12374.html</link><description /><language>zh-cn</language><lastBuildDate>Thu, 03 Dec 2009 13:28:17 GMT</lastBuildDate><pubDate>Thu, 03 Dec 2009 13:28:17 GMT</pubDate><ttl>60</ttl><item><title>boost::filestream组件封装</title><link>http://www.cppblog.com/bujiwu/archive/2009/11/23/101692.html</link><dc:creator>bujiwu</dc:creator><author>bujiwu</author><pubDate>Mon, 23 Nov 2009 05:44:00 GMT</pubDate><guid>http://www.cppblog.com/bujiwu/archive/2009/11/23/101692.html</guid><wfw:comment>http://www.cppblog.com/bujiwu/comments/101692.html</wfw:comment><comments>http://www.cppblog.com/bujiwu/archive/2009/11/23/101692.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/bujiwu/comments/commentRss/101692.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/bujiwu/services/trackbacks/101692.html</trackback:ping><description><![CDATA[为了方便日常使用boost::filestream组件，将boost::filestream组件的基本封装。<br><br>
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #008000;">/*</span><span style="color: #008000;">*&nbsp;<br>&nbsp;*&nbsp;@file&nbsp;FileSystem.h<br>&nbsp;*&nbsp;@brief&nbsp;Operation&nbsp;file&nbsp;or&nbsp;diretory<br>&nbsp;*&nbsp;@author&nbsp;Jiwu&nbsp;Bu<br>&nbsp;*&nbsp;@version&nbsp;1.0.0<br>&nbsp;*&nbsp;@date&nbsp;2009-11-23<br>&nbsp;</span><span style="color: #008000;">*/</span><span style="color: #000000;"><br>#ifndef&nbsp;FILESYSTEM_H_H<br></span><span style="color: #0000ff;">#define</span><span style="color: #000000;">&nbsp;FILESYSTEM_H_H</span><span style="color: #000000;"><br><br>#include&nbsp;</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">iostream</span><span style="color: #000000;">&gt;</span><span style="color: #000000;"><br>#include&nbsp;</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">vector</span><span style="color: #000000;">&gt;</span><span style="color: #000000;"><br><br></span><span style="color: #0000ff;">using</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">namespace</span><span style="color: #000000;">&nbsp;std;<br><br></span><span style="color: #0000ff;">class</span><span style="color: #000000;">&nbsp;CFileSystem<br>{<br></span><span style="color: #0000ff;">public</span><span style="color: #000000;">:<br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">/*</span><span style="color: #008000;">*&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@brief&nbsp;Gets&nbsp;an&nbsp;array&nbsp;of&nbsp;dirctories&nbsp;from&nbsp;current&nbsp;direcoty,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;using&nbsp;Recur&nbsp;value&nbsp;to&nbsp;determine&nbsp;whether&nbsp;to&nbsp;search&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;subdirectories.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;SubDirVec&nbsp;Ouput&nbsp;parameter,&nbsp;return&nbsp;the&nbsp;search&nbsp;result<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;DirPath<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;Recur&nbsp;&nbsp;Whether&nbsp;search&nbsp;subdirectories.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">*/</span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">static</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">bool</span><span style="color: #000000;">&nbsp;GetDirectories(vector</span><span style="color: #000000;">&lt;</span><span style="color: #0000ff;">string</span><span style="color: #000000;">&gt;&amp;</span><span style="color: #000000;">&nbsp;SubDirVec,&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">const</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">string</span><span style="color: #000000;">&amp;</span><span style="color: #000000;">&nbsp;DirPath,&nbsp;</span><span style="color: #0000ff;">bool</span><span style="color: #000000;">&nbsp;Recur&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">false</span><span style="color: #000000;">);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">/*</span><span style="color: #008000;">*&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@brief&nbsp;Get&nbsp;the&nbsp;names&nbsp;of&nbsp;files&nbsp;in&nbsp;the&nbsp;specified&nbsp;directory&nbsp;that&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;match&nbsp;the&nbsp;specified&nbsp;extensive&nbsp;name,&nbsp;using&nbsp;a&nbsp;value&nbsp;to&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;determine&nbsp;whether&nbsp;to&nbsp;search&nbsp;subdirectories.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;FileVec&nbsp;Ouput&nbsp;parameter,&nbsp;return&nbsp;the&nbsp;search&nbsp;result<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;DirPath<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;ExeName&nbsp;Extensive&nbsp;name,&nbsp;if&nbsp;ExeName&nbsp;equal&nbsp;&nbsp;"*.*"&nbsp;&nbsp;search&nbsp;all&nbsp;file<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;Recur&nbsp;&nbsp;&nbsp;Whether&nbsp;search&nbsp;subdirectories<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">*/</span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">static</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">bool</span><span style="color: #000000;">&nbsp;GetFiles(vector</span><span style="color: #000000;">&lt;</span><span style="color: #0000ff;">string</span><span style="color: #000000;">&gt;&amp;</span><span style="color: #000000;">&nbsp;FileVec,&nbsp;</span><span style="color: #0000ff;">const</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">string</span><span style="color: #000000;">&amp;</span><span style="color: #000000;">&nbsp;DirPath,&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">const</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">string</span><span style="color: #000000;">&amp;</span><span style="color: #000000;">&nbsp;ExeName,&nbsp;</span><span style="color: #0000ff;">bool</span><span style="color: #000000;">&nbsp;Recur&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">false</span><span style="color: #000000;">);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">/*</span><span style="color: #008000;">*&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@brief&nbsp;Create&nbsp;a&nbsp;new&nbsp;directory.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;Dir&nbsp;&nbsp;New&nbsp;directory&nbsp;path.&nbsp;Example:/home/bujiwu/test<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;&nbsp;true,&nbsp;if&nbsp;success<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;false,&nbsp;if&nbsp;failed<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">*/</span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">static</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">bool</span><span style="color: #000000;">&nbsp;CreateDirectory(</span><span style="color: #0000ff;">const</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">string</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">&amp;</span><span style="color: #000000;">&nbsp;Dir);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">/*</span><span style="color: #008000;">*&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@brief&nbsp;Judge&nbsp;whether&nbsp;this&nbsp;file&nbsp;or&nbsp;diretory&nbsp;exists.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;Path<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;&nbsp;true,&nbsp;if&nbsp;exists<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;false,&nbsp;if&nbsp;not&nbsp;exists<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">*/</span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">static</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">bool</span><span style="color: #000000;">&nbsp;Exists(</span><span style="color: #0000ff;">const</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">string</span><span style="color: #000000;">&amp;</span><span style="color: #000000;">&nbsp;Path);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">/*</span><span style="color: #008000;">*&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@brief&nbsp;Delete&nbsp;this&nbsp;file&nbsp;or&nbsp;directory<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;Path<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">*/</span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">static</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">void</span><span style="color: #000000;">&nbsp;Delete(</span><span style="color: #0000ff;">const</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">string</span><span style="color: #000000;">&amp;</span><span style="color: #000000;">&nbsp;Path);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">/*</span><span style="color: #008000;">*&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@brief&nbsp;Move&nbsp;file&nbsp;or&nbsp;directory&nbsp;from&nbsp;FromPath&nbsp;to&nbsp;ToPath.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;FromPath<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;ToPath<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">*/</span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">static</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">void</span><span style="color: #000000;">&nbsp;Move(</span><span style="color: #0000ff;">const</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">string</span><span style="color: #000000;">&amp;</span><span style="color: #000000;">&nbsp;FromPath,&nbsp;</span><span style="color: #0000ff;">const</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">string</span><span style="color: #000000;">&amp;</span><span style="color: #000000;">&nbsp;ToPath);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">/*</span><span style="color: #008000;">*&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@brief&nbsp;Copy&nbsp;file&nbsp;or&nbsp;directory&nbsp;from&nbsp;FromPath&nbsp;to&nbsp;ToPath.<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;FromPath<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;ToPath<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">*/</span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">static</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">void</span><span style="color: #000000;">&nbsp;Copy(</span><span style="color: #0000ff;">const</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">string</span><span style="color: #000000;">&amp;</span><span style="color: #000000;">&nbsp;FromPath,&nbsp;</span><span style="color: #0000ff;">const</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">string</span><span style="color: #000000;">&amp;</span><span style="color: #000000;">&nbsp;ToPath);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">/*</span><span style="color: #008000;">*&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@brief&nbsp;Get&nbsp;file&nbsp;size<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@param&nbsp;FilePath<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;*&nbsp;@return&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #008000;">*/</span><span style="color: #000000;"><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">static</span><span style="color: #000000;">&nbsp;unsigned&nbsp;</span><span style="color: #0000ff;">long</span><span style="color: #000000;">&nbsp;GetFileSize(</span><span style="color: #0000ff;">const</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">string</span><span style="color: #000000;">&amp;</span><span style="color: #000000;">&nbsp;FilePath);<br>};<br><br></span><span style="color: #0000ff;">#endif</span><span style="color: #000000;"><br></span></div>
<br>测试用例：<br>
<div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; background-color: #eeeeee; font-size: 13px; width: 98%;"><!--<br><br>Code highlighting produced by Actipro CodeHighlighter (freeware)<br>http://www.CodeHighlighter.com/<br><br>--><span style="color: #000000;">#include&nbsp;</span><span style="color: #000000;">"</span><span style="color: #000000;">../FileSystem/FileSystem.h</span><span style="color: #000000;">"</span><span style="color: #000000;"><br>#include&nbsp;</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">algorithm</span><span style="color: #000000;">&gt;</span><span style="color: #000000;"><br>#include&nbsp;</span><span style="color: #000000;">&lt;</span><span style="color: #000000;">iterator</span><span style="color: #000000;">&gt;</span><span style="color: #000000;"><br>#include&nbsp;</span><span style="color: #000000;">&lt;</span><span style="color: #0000ff;">string</span><span style="color: #000000;">&gt;</span><span style="color: #000000;"><br><br></span><span style="color: #0000ff;">using</span><span style="color: #000000;">&nbsp;</span><span style="color: #0000ff;">namespace</span><span style="color: #000000;">&nbsp;std;<br><br></span><span style="color: #0000ff;">int</span><span style="color: #000000;">&nbsp;main(</span><span style="color: #0000ff;">int</span><span style="color: #000000;">&nbsp;argc,&nbsp;</span><span style="color: #0000ff;">char</span><span style="color: #000000;">*</span><span style="color: #000000;">&nbsp;argv[])<br>{<br>&nbsp;&nbsp;&nbsp;&nbsp;vector</span><span style="color: #000000;">&lt;</span><span style="color: #0000ff;">string</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">&nbsp;MyVec;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">string</span><span style="color: #000000;">&nbsp;Path&nbsp;</span><span style="color: #000000;">=</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">"</span><span style="color: #000000;">/home/bujiwu/EncapDirectory</span><span style="color: #000000;">"</span><span style="color: #000000;">;<br>&nbsp;&nbsp;&nbsp;&nbsp;<br>&nbsp;&nbsp;&nbsp;&nbsp;CFileSystem::Copy(</span><span style="color: #000000;">"</span><span style="color: #000000;">/home/bujiwu/epoll</span><span style="color: #000000;">"</span><span style="color: #000000;">,&nbsp;Path);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;CFileSystem::GetFiles(MyVec,&nbsp;Path,&nbsp;</span><span style="color: #000000;">"</span><span style="color: #000000;">*.*</span><span style="color: #000000;">"</span><span style="color: #000000;">,&nbsp;</span><span style="color: #0000ff;">true</span><span style="color: #000000;">);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;copy(MyVec.begin(),&nbsp;MyVec.end(),&nbsp;ostream_iterator</span><span style="color: #000000;">&lt;</span><span style="color: #0000ff;">string</span><span style="color: #000000;">&gt;</span><span style="color: #000000;">(cout&nbsp;,&nbsp;</span><span style="color: #000000;">"</span><span style="color: #000000;">\n</span><span style="color: #000000;">"</span><span style="color: #000000;">)&nbsp;);<br><br>&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000ff;">return</span><span style="color: #000000;">&nbsp;</span><span style="color: #000000;">0</span><span style="color: #000000;">;<br>}<br></span></div>
<br><a  href="http://www.cppblog.com/Files/bujiwu/FileSystem.rar">http://www.cppblog.com/Files/bujiwu/FileSystem.rar</a><br><br><img src ="http://www.cppblog.com/bujiwu/aggbug/101692.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bujiwu/" target="_blank">bujiwu</a> 2009-11-23 13:44 <a href="http://www.cppblog.com/bujiwu/archive/2009/11/23/101692.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>在Linux与Winodws下编译boost</title><link>http://www.cppblog.com/bujiwu/archive/2009/11/23/101689.html</link><dc:creator>bujiwu</dc:creator><author>bujiwu</author><pubDate>Mon, 23 Nov 2009 05:31:00 GMT</pubDate><guid>http://www.cppblog.com/bujiwu/archive/2009/11/23/101689.html</guid><wfw:comment>http://www.cppblog.com/bujiwu/comments/101689.html</wfw:comment><comments>http://www.cppblog.com/bujiwu/archive/2009/11/23/101689.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.cppblog.com/bujiwu/comments/commentRss/101689.html</wfw:commentRss><trackback:ping>http://www.cppblog.com/bujiwu/services/trackbacks/101689.html</trackback:ping><description><![CDATA[需要编译的库：<br>date_time<br>filesystem<br>function_types<br>graph<br>iostreams<br>math<br>mpi<br>program_options<br>python<br>regex<br>serialization<br>signals<br>system<br>test<br>thread<br>wave<br><br><br>Windows:<br>1、开始菜单--Microsoft Visual Studio 2008--Visual Studio Tools---Open Visual Studio 2008 Command Prompt 打开命令行窗口<br>3、利用cd命令进入到：boost-&gt;toos-&gt;jam-&gt;src目录<br>4、编译，vc 2008输入命令：build vc9<br>5、把生成的bjam.exe(bin.ntx86目录下)拷贝到Boost根目录下，输入命令：<br>6、bjam --with-regex<br><br>Linux:<br>&nbsp;$cd path/to/boost_1_40_0<br>&nbsp;$ ./bootstrap.sh<br>&nbsp;产生bjam文件<br>&nbsp; <br>&nbsp;$ ./bjam install&nbsp; 安装所有<br>&nbsp;$./bjam --with-regex&nbsp; 安装特定的库<br>&nbsp;$./bjam --with-filesystem<br><br>&nbsp;#./bjam --with-filesystem "-sTOOLS=gcc" "--includedir=/usr/include" "--libdir=/usr/lib/boost" install<br><br> <img src ="http://www.cppblog.com/bujiwu/aggbug/101689.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cppblog.com/bujiwu/" target="_blank">bujiwu</a> 2009-11-23 13:31 <a href="http://www.cppblog.com/bujiwu/archive/2009/11/23/101689.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>