Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > boost::regex_replace compiler error

Reply
Thread Tools

boost::regex_replace compiler error

 
 
Yahooooooooo
Guest
Posts: n/a
 
      01-22-2007
Hi,

whats the issue in below code ...

#include <iostream>
#include <fstream>
#include <sstream>
#include <string>
#include <iterator>
#include <boost/regex.hpp>
using namespace std;

extern const char* pre= " "; // i want to remove space
extern const char* post="";

int main(void)
{
string line;
boost::regex rex1(pre);
std:stringstream osstr(std::ios:ut);
std:stream_iterator<char> osit(osstr);

ifstream fh("/tmp/log.conf");
getline(fh,line);
cout << line << endl;


boost::regex_replace(osit,line.begin(),line.end(), rex1,post,boost::match_default
| boost::format_all);

//cout <<"--"<<rex1.str()<<"--"<<endl;

fh.close();
return 1;
}

getting compiler error as below

# g++ -o runme filename.cc

/usr/include/g++/stl_uninitialized.h:71: template instantiation depth
exceeds maximum of 17
/usr/include/g++/stl_uninitialized.h:71: (use -ftemplate-depth-NN to
increase the maximum)
/usr/include/g++/stl_uninitialized.h:71: instantiating
`__uninitialized_copy_aux<const boost::sub_match<char *> *,
boost::sub_match<char *> *>(const boost::sub_match<char *> *, const
boost::sub_match<char *> *, boost::sub_match<char *> *, __false_type)

..............................
..............................
..............................

 
Reply With Quote
 
 
 
 
David Harmon
Guest
Posts: n/a
 
      01-22-2007
On 21 Jan 2007 21:26:10 -0800 in comp.lang.c++, "Yahooooooooo"
<> wrote,
>getting compiler error as below
>
># g++ -o runme filename.cc
>
>/usr/include/g++/stl_uninitialized.h:71: template instantiation depth
>exceeds maximum of 17
>/usr/include/g++/stl_uninitialized.h:71: (use -ftemplate-depth-NN to
>increase the maximum)


Is there some reason you did not do what the message told you to do?

 
Reply With Quote
 
 
 
 
Yahooooooooo
Guest
Posts: n/a
 
      01-22-2007
Tried the same...

# g++ -ftemplate-depth-100 -o runme filename.cc

/tmp/ccZsPAPd.o: In function
`boost::re_detail::basic_regex_creator<char, boost::regex_traits<char,
boost::c_regex_traits<char> >
>::basic_regex_creator(boost::re_detail::regex_dat a<char, boost::regex_traits<char, boost::c_regex_traits<char> > > *)':

/tmp/ccZsPAPd.o(.gnu.linkonce.t.__Q35boost9re_detailt19 basic_regex_creator2ZcZQ25boostt12regex_traits2ZcZ Q25boostt14c_regex_traits1ZcPQ35boost9re_detailt10 regex_data2ZcZQ25boostt12regex_traits2ZcZQ25boostt 14c_regex_traits1Zc+0x6b):
undefined reference to
`boost::c_regex_traits<char>::lookup_classname(cha r const *, char const
*)'
/tmp/ccZsPAPd.o(.gnu.linkonce.t.__Q35boost9re_detailt19 basic_regex_creator2ZcZQ25boostt12regex_traits2ZcZ Q25boostt14c_regex_traits1ZcPQ35boost9re_detailt10 regex_data2ZcZQ25boostt12regex_traits2ZcZQ25boostt 14c_regex_traits1Zc+0x85):
undefined reference to
`boost::c_regex_traits<char>::lookup_classname(cha r const *, char const
*)'
/tmp/ccZsPAPd.o(.gnu.linkonce.t.__Q35boost9re_detailt19 basic_regex_creator2ZcZQ25boostt12regex_traits2ZcZ Q25boostt14c_regex_traits1ZcPQ35boost9re_detailt10 regex_data2ZcZQ25boostt12regex_traits2ZcZQ25boostt 14c_regex_traits1Zc+0x9f):
undefined reference to
`boost::c_regex_traits<char>::lookup_classname(cha r const *, char const
*)'
/tmp/ccZsPAPd.o(.gnu.linkonce.t.__Q35boost9re_detailt19 basic_regex_creator2ZcZQ25boostt12regex_traits2ZcZ Q25boostt14c_regex_traits1ZcPQ35boost9re_detailt10 regex_data2ZcZQ25boostt12regex_traits2ZcZQ25boostt 14c_regex_traits1Zc+0xb9):
undefined reference to
`boost::c_regex_traits<char>::lookup_classname(cha r const *, char const
*)'



David Harmon wrote:
> On 21 Jan 2007 21:26:10 -0800 in comp.lang.c++, "Yahooooooooo"
> <> wrote,
> >getting compiler error as below
> >
> ># g++ -o runme filename.cc
> >
> >/usr/include/g++/stl_uninitialized.h:71: template instantiation depth
> >exceeds maximum of 17
> >/usr/include/g++/stl_uninitialized.h:71: (use -ftemplate-depth-NN to
> >increase the maximum)

>
> Is there some reason you did not do what the message told you to do?


 
Reply With Quote
 
Diwa
Guest
Posts: n/a
 
      01-24-2007

David Harmon wrote:
> On 21 Jan 2007 21:26:10 -0800 in comp.lang.c++, "Yahooooooooo"
> <> wrote,
> >getting compiler error as below
> >
> ># g++ -o runme filename.cc
> >
> >/usr/include/g++/stl_uninitialized.h:71: template instantiation depth
> >exceeds maximum of 17
> >/usr/include/g++/stl_uninitialized.h:71: (use -ftemplate-depth-NN to
> >increase the maximum)

>
> Is there some reason you did not do what the message told you to do?


Some libs of boost require a library while most can be used by just
including header files.
Regex of boost requires a library. (Build it first from sources)

The error goes away when I use following:
---------------------------------------------------------
g++ -I<boost_incl_dir> -L <boost_lib_dir> -lboost_regex-gcc-d-1_33_1
filename.cc
---------------------------------------------------------

Thanks
Diwakar

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Compiler Error Message: The compiler failed with error code -1073741819 Ram ASP .Net 0 09-13-2005 09:52 AM
Why is a JIT compiler faster than a byte-compiler RickMuller Python 4 03-26-2005 04:30 PM
Compiler compiler with C++ as output Andrey Batyuck C++ 3 05-17-2004 08:17 PM
Can we use <compiler> tag to avoid RunTime Compiler error? Jack Wright ASP .Net 5 01-19-2004 04:36 PM
Compiler Error Message: The compiler failed with error code 128. Yan ASP .Net 0 07-21-2003 10:49 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57