473,320 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

boost::regex_replace compiler error

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::ostringstream osstr(std::ios::out);
std::ostream_iterator<charosit(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)

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

Jan 22 '07 #1
3 2618
On 21 Jan 2007 21:26:10 -0800 in comp.lang.c++, "Yahooooooooo"
<m.******@gmail.comwrote,
>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?

Jan 22 '07 #2
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"
<m.******@gmail.comwrote,
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?
Jan 22 '07 #3

David Harmon wrote:
On 21 Jan 2007 21:26:10 -0800 in comp.lang.c++, "Yahooooooooo"
<m.******@gmail.comwrote,
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

Jan 24 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: derek.google | last post by:
I hope a Boost question is not too off-topic here. It seems that upgrading to Boost 1.33 broke some old regex code that used to work. I have reduced the problem to this simple example: cout <<...
7
by: Tao Wang | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, I saw cuj's conformance roundup, but the result is quite old. I think many people like me want to know newer c++ standard conformance test...
0
by: ufnuceda | last post by:
Hello everyone, I was wondering if any of you have some experience with the boost library. I am having trouble compiling code with it. Since boost is being used a lot these days I thought some...
2
by: Faheem Mitha | last post by:
Hi, The following bit of code compiles fine with gcc 3.3 or later, but has problems with the Intel C++ compiler version 9.1, which produces the following error message. Is this a compiler...
7
by: Aek | last post by:
Hi everyone, I am trying to construct a regular expression and format string to use with a boost::regex_replace() In my file the sample text is: // .fx shader file FLOAT JOE 3545f; FLOAT...
1
by: Yahooooooooo | last post by:
Just practicing BOOST regular expressions....giving errors... -- wanted to replace SPACE with NULL. #include <iostream> #include <fstream> #include <sstream> #include <string> #include...
5
by: mackenzie | last post by:
Hello, I am looking for a little bit of help. I am trying to create a dynamically allocated object which contains one or more objects of type boost::pool<>. I get a compiler error when an object...
6
by: hsmit.home | last post by:
Hello, I came across a strange error and it's really been bugging me. Maybe someone else has come across this and any insight would be appreciated. What I'm trying to accomplish is using...
1
by: RK | last post by:
I get the following compile-time error while trying to use the in_edges function in boost -- error: no matching function for call to ‘in_edges(vertex_descriptor&, Graph&) The weird part is...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.