Boost Getting Started 安装文档(翻译1.33版本)

积木 2006-03-28 04:07:40
http://blog.csdn.net/goodboy1881/archive/2006/03/27/640004.aspx

因为贴过来效果就不好了。里面太多表格。所以就贴链接过来了。
而且还比较方便修改。
...全文
554 9 打赏 收藏 转发到动态 举报
写回复
用AI写文章
9 条回复
切换为时间正序
请发表友善的回复…
发表回复
shot411 2006-04-25
  • 打赏
  • 举报
回复
good
mark
cunsh 2006-04-25
  • 打赏
  • 举报
回复
mark
yeyuboy 2006-04-25
  • 打赏
  • 举报
回复
www.stlchina.org关于boost的中文资料比较丰富,还有《Beyond the C++ Standard Library》这本boost书籍中文版下载。
rickerliang 2006-04-25
  • 打赏
  • 举报
回复
支持新标准库的一部分
iamcaicainiao 2006-04-24
  • 打赏
  • 举报
回复
支持。
stan_uni 2006-04-24
  • 打赏
  • 举报
回复
不错,看看
yyuyes 2006-04-02
  • 打赏
  • 举报
回复
忘了说,安装好了Boost,VC中要使用boost库,必须在“工程”->“设置”->C/C++选项卡,选择分类“Preprocessor(有的汉化版的VC是显示预处理器)”中,附加包含路径 中包$boost_root$

这样,就可以使用Boost库了。

最后,贴个例子吧:(改自boost自带例子)
-----------------regex_test.cpp---------------------------
/*
* 修改自: $boost_root$\libs\regex\example\snippets\regex_token_iterator_eg_2.cpp
* 功能: 分析D:\test.htm文件中的超链接,test.htm为HTML文件
*/

#include <fstream>
#include <iostream>
#include <iterator>
#include <boost/regex.hpp>

boost::regex e("<\\s*A\\s+[^>]*href\\s*=\\s*\"([^\"]*)\"",
boost::regex::normal | boost::regbase::icase);

void load_file(std::string& s, std::istream& is)
{
s.erase();
if(is.bad()) return;
s.reserve(is.rdbuf()->in_avail());//attempt to grow string buffer to match file size, this doesn't always work...
char c;
while(is.get(c))
{// use logarithmic growth stategy, in case in_avail (above) returned zero:
if(s.capacity() == s.size())
s.reserve(s.capacity() * 3);
s.append(1, c);
}
}

int main(int argc, char** argv)
{
std::string fcontent;
std::string sPath;
sPath="D:\\test.htm";

std::cout << "Findings URL's in " << sPath << ":" << std::endl<<std::endl;
s.erase();

std::ifstream is(sPath.c_str());
load_file(fcontent, is);
is.close();

int count=0;

sregex_token_iterator i(fcontent.begin(), fcontent.end(), re, 1);
sregex_token_iterator j;

while(i != j)
{
cout << *i++ << endl;
count++;
}
cout << "TOTAL Matchs: "<< count <<endl;

return 0;
}

----------------------------------------------------------
yyuyes 2006-04-02
  • 打赏
  • 举报
回复
boost库安装比较简单:

主要可以分为两类方式:

1、使用bjam方式:这是boost推荐的方式;但是你如果没有这个工具的话,需要自己编译或者直接下载一个人家已经编译好的bjam工具,看起来好象有点麻烦,呵呵;能用bjam的同志们应该就不用看我写的这个入门级的回贴了

2、通过Makefile文件:下面以VC6编译正则表达式库boost.regex举例
A、解压Boost压缩包到硬盘目录下,以下称为$boost_root$
B、在命令行下进入$boost_root$\libs\regex\build目录,你会看到很多.mak文件,分别是各个常见编译器各版本的make文件
C、命令行下依次执行:
nmake -fvc6.mak
nmake -fvc6.mak install
nmake -fvc6.mak clean
D、$boost_root$\libs\regex\test目录下有供测试正则表达式库的工程

我想,很多初学者暂时不必管ICU是什么玩意,关于ICU的我就不翻译了,想了解的话,自己查看$boost_root$\libs\regex\doc\install.html#vc目录
roger_77 2006-04-02
  • 打赏
  • 举报
回复
好东西,顶一下.

24,854

社区成员

发帖
与我相关
我的任务
社区描述
C/C++ 工具平台和程序库
社区管理员
  • 工具平台和程序库社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧