- 论坛徽章:
- 0
|
代码如下:
1 #include <boost/regex.hpp>
2 #include <iostream>
3
4 using namespace std;
5
6
7 int main(void)
8 {
9 boost::regex reg("test");
10
11 bool b = boost::regex_match("A test string", reg);
12
13 if (b) {
14 cout<<"Success"<<endl;
15 }
16 else {
17 cout<<"Failed!\n";
18 }
19
20 return 0;
21 }
环境是CentOS 5.2,编译,链接都没有问题,但是一运行,就出现了段错误,用GDB调试,发现:
Segmentation fault.
0x08048f68 in ~repeater_count (this=0xbfc5c378) at /usr/include/boost/regex/v4/perl_matcher.hpp:270
270 *stack = next;
在VS2005下工作的就很好,不知道为什么,呵呵。
[ 本帖最后由 zijian1984 于 2009-2-22 13:17 编辑 ] |
|