Opened 21 years ago

Closed 19 years ago

#68 closed Support Requests (Out of Date)

problem with using regex

Reported by: nobody Owned by: John Maddock
Milestone: Component: None
Version: None Severity:
Keywords: Cc:

Description

I'm trying to use your regex class.
I'm using boost_1_27_0 on Solaris compiled with 
Workshop 6 update 1.
The build of the sample 
site :http://www.boost.org/libs/regex/example/snippets/
regex_match_example.cpp
//THE SAMPLE START 
{
#include <stdio.h>
#include <boost/regex.hpp>

using namespace std;
using namespace boost;
 
#define CHAR char
void main()
{
char *format = "(.*)";
regex expression(format, regbase :: normal, a );

}
//SAMPLE FINISHED
is failed with the following error:

$CC -g -
I/usr/mwdata/users/olga/boost_1_27_0 /usr/mwdata/users/
olga/boost_1_27_0/libs/regex/build/sunpro/libboost_rege
x_mt.so test.C -o test
// ERROR START
Undefined                       first referenced
 symbol                             in file
boost::detail::allocator<unsigned 
char>::allocator<char>#Nvariant 1(const 
boost::detail::allocator<__type_1>&) /vobs/studio/serve
r/debugger/SunWS_cache/CC_obj_h/hKZggW9H89qzPd1td_2e.o
ld: fatal: Symbol referencing errors. No output 
written to test/test1
// ERROR FINISHED

I have found that the problem comming from the 
expression initialization line:
regex expression("^([0-9]+)(\\-| |$)(.*)$");

regex was  defined as  "typedef reg_expression < 
CHAR , regex_traits < CHAR > , :: boost :: detail :: 
allocator < CHAR > > regex"
and the problem is in allocator initialization.

If I put the only line with allocator initialization 
into the sample like:
//THE SAMPLE START 
{
#include <stdio.h>
#include <boost/regex.hpp>

using namespace std;
using namespace boost;
 
#define CHAR char
void main()
{
char *format = "(.*)";
:: boost :: detail :: allocator < char>  a;
}
//SAMPLE FINISHED

 
the build is failed with the same error.

How could I save this problem with 'Undefined 
symbol'???


Change History (2)

comment:1 by nobody, 19 years ago

Logged In: NO 

It's a known problem with sunpro in debug mode.  What 
happens if you change line 78 of boost/detail/allocator.hpp to:

#elif !defined(BOOST_NO_MEMBER_TEMPLATES) && !
defined(__SUNPRO_CC)

???

John.

comment:2 by John Maddock, 19 years ago

Status: assignedclosed
Note: See TracTickets for help on using tickets.