安装boost库的问题

flydream1980 2009-01-11 07:28:10
装了个boost 库,不知道哪个步骤不对, 给一个简单的测试,如下
#include <iostream>
#include <cassert>
#include <string>
#include <boost/regex.hpp>
using namespace std;
using namespace boost;
int main()
{
regex reg("\\w(.+)@(.+)\\.com");
string correct = "boluo1982107@ccc122.com";
assert(regex_match(correct,reg)==true);
return 0;
}
结果都是

Build options aren't compatible with pre-built libraries

感觉好像是库装的有问题。
大家帮小弟看看哪步有误?


环境 VC6.0 + intel compiler9.1 + STLPort5.2.1。 stlport用icl 编译的,没问题。
下载的boost库是最新的 boost1.37
1 解压boost_1_37_0.7z 到D:\Program Files。 D:\Program Files\boost_1_37_0
2 打开一个控制台,(icl 都是配置好的,环境变量等均没问题)
3 进入 D:\Program Files\boost_1_37_0\tools\jam\src
4 运行 build.bat icl
但是提示 Unknown toolset: icl
....
Toolsets supported by this script are: borland, como, gcc, gcc-nocygwin, intel-win32, metrowerks, mingw, msvc, vc7, vc8
....

所以运行 build.bat intel-win32。生成目录 bin.ntx86,里面是 bjam.exe
5 将上一步得到的 bjam.exe 拷贝到D:\Program Files\boost_1_37_0目录 。
6 进到该目录。运行
bjam.exe "-sTOOLS=intel-win32-stlport" "-sINTEL_VERSION=9.1" "-sINTEL_PATH=D:\Program Files\Intel\Compiler\C++\9.1\IA32" "-sSTLPORT_5.2.1_PATH=D:\Program Files\STLport-5.2.1" "-sSTLPORT_VERSION=5.2.1" stage

7 编译完成后测试
在"Include files" 中添加 D:\PROGRAM FILES\BOOST_1_37_0
在"Library files" 中添加 D:\PROGRAM FILES\BOOST_1_37_0\STAGE\LIB

8
输入代码
#include <iostream>
#include <cassert>
#include <string>
#include <boost/regex.hpp>
using namespace std;
using namespace boost;
int main()
{
regex reg("\\w(.+)@(.+)\\.com");
string correct = "boluo1982107@ccc122.com";
assert(regex_match(correct,reg)==true);
return 0;
}

出现最上面所说的错误。

编译器用的 intel compiler,库是 stlport。
各位高手,帮小弟看看是什么问题?哪一步有问题

...全文
624 12 打赏 收藏 转发到动态 举报
写回复
用AI写文章
12 条回复
切换为时间正序
请发表友善的回复…
发表回复
lin12345 2009-01-12
  • 打赏
  • 举报
回复
不明,帮顶
tccqs 2009-01-11
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 xiaoyisnail 的回复:]
mark
帮顶~.
[/Quote]
.
Proteas 2009-01-11
  • 打赏
  • 举报
回复
另外,网络上有个boost正则测试程序,
是一个开源的东东,可以下载下来做个参考,
也可以做测试正则表达式用,
但是那个程序没处理一个异常,
用几个字符可以让它崩溃,
用的时候要小心.
Proteas 2009-01-11
  • 打赏
  • 举报
回复
boost的正则库在一个项目里用过.
我只记得编译后需要改一下dll名字,
好像是要把小版本号去掉.
boost的正则库很强大,
但是什么都抛异常,
处理时要注意下.
bitxinhai 2009-01-11
  • 打赏
  • 举报
回复
在你的tools-》options把boost库的位置设置一下,
看看结果如何!!!!!
xiaoyisnail 2009-01-11
  • 打赏
  • 举报
回复
mark
帮顶~
taodm 2009-01-11
  • 打赏
  • 举报
回复
楼主,你这套组合还是老老实实用boost1.33吧。
regex库从1.33起没咋变过。
baihacker 2009-01-11
  • 打赏
  • 举报
回复
我是用cl的,没出啥问题.
waizqfor 2009-01-11
  • 打赏
  • 举报
回复
[Quote=引用 3 楼 flydream1980 的回复:]
2 楼。
D:\>cl
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]

D:\>icl
Intel(R) C++ Compiler for 32-bit applications, Version 9.1 Build 20060706Z Pa
ckage ID: W_CC_C_9.1.028
Copyright (C) 1985-2006 Intel Corporation. All right…
[/Quote]
恩 你说得那个编译器环境确实很少 帮你看一下 都没有太实质的东西
flydream1980 2009-01-11
  • 打赏
  • 举报
回复
2 楼。
D:\>cl
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8804 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

usage: cl [ option... ] filename... [ /link linkoption... ]

D:\>icl
Intel(R) C++ Compiler for 32-bit applications, Version 9.1 Build 20060706Z Pa
ckage ID: W_CC_C_9.1.028
Copyright (C) 1985-2006 Intel Corporation. All rights reserved.

icl: Command line error: no files specified; for help type "icl /help"

D:\>

不少资料都是 vc6,vc8编译的。好像很少 intel 编译的
waizqfor 2009-01-11
  • 打赏
  • 举报
回复
http://www.yuanma.org/data/2007/0521/article_2606.htm
这有一个XP下 VC6的安装加测试
baihacker 2009-01-11
  • 打赏
  • 举报
回复
换cl呢?

65,211

社区成员

发帖
与我相关
我的任务
社区描述
C++ 语言相关问题讨论,技术干货分享,前沿动态等
c++ 技术论坛(原bbs)
社区管理员
  • C++ 语言社区
  • encoderlee
  • paschen
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
  1. 请不要发布与C++技术无关的贴子
  2. 请不要发布与技术无关的招聘、广告的帖子
  3. 请尽可能的描述清楚你的问题,如果涉及到代码请尽可能的格式化一下

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