472,964 Members | 2,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

boost::regex - fail to compile a simple sample

I use SunOS 5.8, gcc 3.3.2, boost 1.33.1.
I have build the entire boost package and try to compile a simple
example:

#include <iostream>
#include <string>
#include <boost/regex.hpp // Boost.Regex lib

using namespace std;

int main( ) {

std::string s, sre;
boost::regex re;

while(true)
{
cout << "Expression: ";
cin >sre;
if (sre == "quit")
{
break;
}
cout << "String: ";
cin >s;

// Set up the regular expression for case-insensitivity
re.assign(sre, boost::regex_constants::icase);
if (boost::regex_match(s, re))
{
cout << re << " matches " << s << endl;
}
}
}

try to compile it this way [path for include files and static libs are
ok]:
g++ -o test test.cc -I$ROOT/include/ -L$ROOT/lib -lboost_regex-gcc

But i get:

Undefined first referenced
symbol in file
boost::re_detail::c_traits_base::class_map /var/tmp//ccBM7Erf.o
boost::re_detail::c_traits_base::lower_case_map
/var/tmp//ccBM7Erf.o
boost::reg_expression<char, boost::regex_traits<char>,
std::allocator<char>
>::reg_expression[not-in-charge](std::allocator<charconst&)/var/tmp//ccBM7Erf.o
boost::reg_expression<char, boost::regex_traits<char>,
std::allocator<char::size() const/var/tmp//ccBM7Erf.o
boost::reg_expression<char, boost::regex_traits<char>,
std::allocator<char::empty() const/var/tmp//ccBM7Erf.o
boost::reg_expression<char, boost::regex_traits<char>,
std::allocator<char::~reg_expression
[not-in-charge]()/var/tmp//ccBM7Erf.o
boost::reg_expression<char, boost::regex_traits<char>,
std::allocator<char::first(boost::reg_expression<c har,
boost::regex_traits<char>, std::allocator<char
const&)/var/tmp//ccBM7Erf.o
boost::reg_expression<char, boost::regex_traits<char>,
std::allocator<char::mark_count() const/var/tmp//ccBM7Erf.o
boost::reg_expression<char, boost::regex_traits<char>,
std::allocator<char::can_start(char, unsigned char const*, unsigned
char, boost::re_detail::_narrow_type const&)/var/tmp//ccBM7Erf.o
boost::c_regex_traits<char>::transform_primary(std ::basic_string<char,
std::char_traits<char>, std::allocator<char&,
std::basic_string<char, std::char_traits<char>, std::allocator<char
const&)/var/tmp//ccBM7Erf.o
boost::reg_expression<char, boost::regex_traits<char>,
std::allocator<char::set_expression(char const*, char const*,
unsigned)/var/tmp//ccBM7Erf.o
boost::re_detail::raise_regex_exception(std::basic _string<char,
std::char_traits<char>, std::allocator<char
const&)/var/tmp//ccBM7Erf.o
boost::c_regex_traits<char>::transform(std::basic_ string<char,
std::char_traits<char>, std::allocator<char&,
std::basic_string<char, std::char_traits<char>, std::allocator<char
const&)/var/tmp//ccBM7Erf.o
boost::re_detail::c_traits_base::error_string(unsi gned)/var/tmp//ccBM7Erf.o
boost::reg_expression<char, boost::regex_traits<char>,
std::allocator<char::get_traits() const/var/tmp//ccBM7Erf.o
boost::reg_expression<char, boost::regex_traits<char>,
std::allocator<char::str() const/var/tmp//ccBM7Erf.o
ld: fatal: Symbol referencing errors. No output written to test
collect2: ld returned 1 exit status
Can anybody help me?
I already looked around the web, but didn't find a clue.

Regards!

Frank

Nov 3 '06 #1
5 7133
FB********@web.de wrote:
I use SunOS 5.8, gcc 3.3.2, boost 1.33.1.
I have build the entire boost package and try to compile a simple
example:

#include <iostream>
#include <string>
#include <boost/regex.hpp // Boost.Regex lib

using namespace std;

int main( ) {

std::string s, sre;
boost::regex re;

while(true)
{
cout << "Expression: ";
cin >sre;
if (sre == "quit")
{
break;
}
cout << "String: ";
cin >s;

// Set up the regular expression for case-insensitivity
re.assign(sre, boost::regex_constants::icase);
if (boost::regex_match(s, re))
{
cout << re << " matches " << s << endl;
}
}
}

try to compile it this way [path for include files and static libs are
ok]:
g++ -o test test.cc -I$ROOT/include/ -L$ROOT/lib -lboost_regex-gcc


But i get:

Undefined first referenced
symbol in file
boost::re_detail::c_traits_base::class_map /var/tmp//ccBM7Erf.o
boost::re_detail::c_traits_base::lower_case_map
/var/tmp//ccBM7Erf.o
boost::reg_expression<char, boost::regex_traits<char>,
std::allocator<char>
::reg_expression[not-in-charge](std::allocator<charconst&)/var/tmp//ccBM7Erf.o
boost::reg_expression<char, boost::regex_traits<char>,
std::allocator<char::size() const/var/tmp//ccBM7Erf.o
boost::reg_expression<char, boost::regex_traits<char>,
std::allocator<char::empty() const/var/tmp//ccBM7Erf.o
boost::reg_expression<char, boost::regex_traits<char>,
std::allocator<char::~reg_expression
[not-in-charge]()/var/tmp//ccBM7Erf.o
boost::reg_expression<char, boost::regex_traits<char>,
std::allocator<char::first(boost::reg_expression<c har,
boost::regex_traits<char>, std::allocator<char
const&)/var/tmp//ccBM7Erf.o
boost::reg_expression<char, boost::regex_traits<char>,
std::allocator<char::mark_count() const/var/tmp//ccBM7Erf.o
boost::reg_expression<char, boost::regex_traits<char>,
std::allocator<char::can_start(char, unsigned char const*, unsigned
char, boost::re_detail::_narrow_type const&)/var/tmp//ccBM7Erf.o
boost::c_regex_traits<char>::transform_primary(std ::basic_string<char,
std::char_traits<char>, std::allocator<char&,
std::basic_string<char, std::char_traits<char>, std::allocator<char
const&)/var/tmp//ccBM7Erf.o
boost::reg_expression<char, boost::regex_traits<char>,
std::allocator<char::set_expression(char const*, char const*,
unsigned)/var/tmp//ccBM7Erf.o
boost::re_detail::raise_regex_exception(std::basic _string<char,
std::char_traits<char>, std::allocator<char
const&)/var/tmp//ccBM7Erf.o
boost::c_regex_traits<char>::transform(std::basic_ string<char,
std::char_traits<char>, std::allocator<char&,
std::basic_string<char, std::char_traits<char>, std::allocator<char
const&)/var/tmp//ccBM7Erf.o
boost::re_detail::c_traits_base::error_string(unsi gned)/var/tmp//ccBM7Erf.o
boost::reg_expression<char, boost::regex_traits<char>,
std::allocator<char::get_traits() const/var/tmp//ccBM7Erf.o
boost::reg_expression<char, boost::regex_traits<char>,
std::allocator<char::str() const/var/tmp//ccBM7Erf.o
ld: fatal: Symbol referencing errors. No output written to test
collect2: ld returned 1 exit status
Can anybody help me?
I already looked around the web, but didn't find a clue.

Regards!

Frank
While you could certainly ask about how to use Boost.Regex here
(because it is part of TR1), linker problems like this are really more
of platform issue and should be addressed either on the Boost user list
(http://boost.org/more/mailing_lists.htm#users) or on a group dedicated
to your platform.

Cheers! --M

Nov 3 '06 #2

"mlimber дµÀ£º
"
my question is :
ompiling...
Cpp1.cpp
warning: STLPort debug versions are built with /D_STLP_DEBUG=1
c:\c++\boost_1_33_1\boost\config\auto_link.hpp(211 ) : fatal error
C1189: #error : "Build options aren't compatible with pre-built
libraries"
Error executing cl.exe.

Cpp1.exe - 1 error(s), 1 warning(s)

help me!

Dec 6 '06 #3
I'AM chinese .so i speak chinese.
please use chinese-english translate software.
if you don't understand what i said.I so sorry.
Ðֵܣ¬ÄãµÄ´úÂëÎÒÔÚWINDOW
ƽ̨ÉÏÃæÊÇ¿ÉÒÔ±àÒëͨ¹ýµÄ¡£

¶ÔÁËÒªÏëʹÓÃREGEX£¬ÄãµÄ»úÆ÷Àï±ØÐëÓÐ
mine is
libboost_regex-vc6-sgd-1_33_1.lib
yours is
libboost_regex-sunpro-sgd-1_33_1.lib
ÎҵľÍÊÇÒòΪûÓÐÕâ¸ö¡£ËùÒÔ±àÒë²»¹ýÈ¥

your code could compile in windows in vc6
look up your lib,and find the "libboost_regex-vc6-sgd-1_33_1.lib"
if not exists,you could compile the file
"libboost_regex-vc6-sgd-1_33_1.lib"
boost\libs\regex\build\
then nmake(in windows is like this,but in sun ,I don't know) the
sunpro.mak

in default ,the libboost_regex-sunpro-sgd-1_33_1.lib isn't compiled
Dec 6 '06 #4
I'am so sorry!!

mine is
libboost_regex-vc6-sgd-1_33_1.lib
yours is
libboost_regex-sunpro-sgd-1_33_1.lib
Dec 6 '06 #5
I'am so sorry!!

mine is
libboost_regex-vc6-sgd-1_33_1.lib
yours is
libboost_regex-sunpro-sgd-1_33_1.lib
Dec 6 '06 #6

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

Similar topics

2
by: Richard Latter | last post by:
Hello All, I am a newbie to the Boost library and I have a question about a simple function. All I would like to do is to create a simple function that can test strings using regular...
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...
3
by: MCH | last post by:
hi there, I am working with a HTML-like text with boost:regex. For example, the following pattern might occur in my text <abc efg> <p>EFG</p 12<3> In this case, I would like to extract...
1
by: Alan Patterson | last post by:
I have installed boost 1.33.1 and everything compiled and installed fine on Windows using Visual C++ 8.0. I wrote the following simple code to test the regex library and it doesn't seem to work....
1
by: Barry | last post by:
I used Boost.Xpressive after 1.3.4, and found it interesting and helpful, but I suffer from long complie-time. So I wonder there is a way to write the regular expression in Xpressive and use it in...
3
by: neino | last post by:
Hello, did anyone of You have problems using boost::regex ? That code below : #include "boost/regex.hpp" /*1*/ int main() /*2*/ { /*3*/...
13
by: brad | last post by:
Still learning C++. I'm writing some regex using boost. It works great. Only thing is... this code seems slow to me compared to equivelent Perl and Python. I'm sure I'm doing something incorrect....
2
by: brad | last post by:
Try the boost mailing list. They may help you. http://www.boost.org/community/groups.html#users
2
by: skip | last post by:
A colleague wrote a C++ library here at work which uses the Boost.regex library. I quickly discovered an apparent problem with how it searches. Unlike re.match the regex_match function in that...
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.