Boost logo

Boost :

From: Boris Schaeling (boris_at_[hidden])
Date: 2001-02-02 11:20:05


I updated to 1.20.1 and thought to give regex a try. :) Using g++ 2.95.2
with regex works fine. But when trying to compile and link with STLport 4.0
linking fails. I tried under Linux and Cygwin and got always the same
errors.

Here's what I did:

-- C++ source: reg.cpp ----------------------------------

#include <boost/regex.hpp>
main() { boost::regex Expression("test"); }

---------------------------------------------------------

Compiling with
  g++ -I./boost_1_20_1 -Wall -W -c reg.cpp
and linking with
  g++ reg.o -o reg -L./boost_1_20_1/libs/regex/lib/gcc -lregex++
works.

Compiling with
  g++ -I./STLport-4.0/stlport -I./boost_1_20_1 -Wall -W -c reg.cpp
works, but linking with
  g++ reg.o -o
reg -L./STLport-4.0/lib -L./boost_1_20_1/libs/regex/lib/gcc -lstlport_gcc -l
regex++
fails and produces these error messages (undefined references to
boost::bad_expression::bad_expression, boost::c_regex_traits::transform and
boost::c_regex_traits::transform_primary):

reg.o: In function `boost::reg_expression<char, boost::regex_traits<char>,
boost::re_detail::jm_def_alloc>::fail(unsigned int)':
reg.o(.boost::reg_expression<char, boost::regex_traits<char>,
boost::re_detail::jm_def_alloc>::gnu.linkonce.t.fail(unsigned int)+0x47):
undefined reference to
`boost::bad_expression::bad_expression(_STL::basic_string<char,
_STL::char_traits<char>, _STL::allocator<char> > const &)'

reg.o: In function `boost::reg_expression<char, boost::regex_traits<char>,
boost::re_detail::jm_def_alloc>::compile_set_aux(boost::re_detail::jstack<_S
TL::basic_string<char, _STL::char_traits<char>, _STL::allocator<char> >,
boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<_STL::basic_string<char, _STL::char_traits<char>,
_STL::allocator<char> >, boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<unsigned int, boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<_STL::basic_string<char, _STL::char_traits<char>,
_STL::allocator<char> >, boost::re_detail::jm_def_alloc> &, bool,
boost::re_detail::_narrow_type const &)':
reg.o(.boost::reg_expression<char, boost::regex_traits<char>,
boost::re_detail::jm_def_alloc>::gnu.linkonce.t.compile_set_aux(boost::re_de
tail::jstack<_STL::basic_string<char, _STL::char_traits<char>,
_STL::allocator<char> >, boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<_STL::basic_string<char, _STL::char_traits<char>,
_STL::allocator<char> >, boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<unsigned int, boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<_STL::basic_string<char, _STL::char_traits<char>,
_STL::allocator<char> >, boost::re_detail::jm_def_alloc> &, bool,
boost::re_detail::_narrow_type const &)+0x14a): undefined reference to
`boost::c_regex_traits<char>::transform(_STL::basic_string<char,
_STL::char_traits<char>, _STL::allocator<char> > &, _STL::basic_string<char,
_STL::char_traits<char>, _STL::allocator<char> > const &)'

reg.o(.boost::reg_expression<char, boost::regex_traits<char>,
boost::re_detail::jm_def_alloc>::gnu.linkonce.t.compile_set_aux(boost::re_de
tail::jstack<_STL::basic_string<char, _STL::char_traits<char>,
_STL::allocator<char> >, boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<_STL::basic_string<char, _STL::char_traits<char>,
_STL::allocator<char> >, boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<unsigned int, boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<_STL::basic_string<char, _STL::char_traits<char>,
_STL::allocator<char> >, boost::re_detail::jm_def_alloc> &, bool,
boost::re_detail::_narrow_type const &)+0x1ba): undefined reference to
`boost::c_regex_traits<char>::transform(_STL::basic_string<char,
_STL::char_traits<char>, _STL::allocator<char> > &, _STL::basic_string<char,
_STL::char_traits<char>, _STL::allocator<char> > const &)'

reg.o(.boost::reg_expression<char, boost::regex_traits<char>,
boost::re_detail::jm_def_alloc>::gnu.linkonce.t.compile_set_aux(boost::re_de
tail::jstack<_STL::basic_string<char, _STL::char_traits<char>,
_STL::allocator<char> >, boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<_STL::basic_string<char, _STL::char_traits<char>,
_STL::allocator<char> >, boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<unsigned int, boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<_STL::basic_string<char, _STL::char_traits<char>,
_STL::allocator<char> >, boost::re_detail::jm_def_alloc> &, bool,
boost::re_detail::_narrow_type const &)+0x2af): undefined reference to
`boost::c_regex_traits<char>::transform(_STL::basic_string<char,
_STL::char_traits<char>, _STL::allocator<char> > &, _STL::basic_string<char,
_STL::char_traits<char>, _STL::allocator<char> > const &)'

reg.o(.boost::reg_expression<char, boost::regex_traits<char>,
boost::re_detail::jm_def_alloc>::gnu.linkonce.t.compile_set_aux(boost::re_de
tail::jstack<_STL::basic_string<char, _STL::char_traits<char>,
_STL::allocator<char> >, boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<_STL::basic_string<char, _STL::char_traits<char>,
_STL::allocator<char> >, boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<unsigned int, boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<_STL::basic_string<char, _STL::char_traits<char>,
_STL::allocator<char> >, boost::re_detail::jm_def_alloc> &, bool,
boost::re_detail::_narrow_type const &)+0x3e0): undefined reference to
`boost::c_regex_traits<char>::transform_primary(_STL::basic_string<char,
_STL::char_traits<char>, _STL::allocator<char> > &, _STL::basic_string<char,
_STL::char_traits<char>, _STL::allocator<char> > const &)'

reg.o: In function `boost::reg_expression<char, boost::regex_traits<char>,
boost::re_detail::jm_def_alloc>::compile_set_aux(boost::re_detail::jstack<_S
TL::basic_string<char, _STL::char_traits<char>, _STL::allocator<char> >,
boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<_STL::basic_string<char, _STL::char_traits<char>,
_STL::allocator<char> >, boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<unsigned int, boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<_STL::basic_string<char, _STL::char_traits<char>,
_STL::allocator<char> >, boost::re_detail::jm_def_alloc> &, bool,
boost::re_detail::_wide_type const &)':

reg.o(.boost::reg_expression<char, boost::regex_traits<char>,
boost::re_detail::jm_def_alloc>::gnu.linkonce.t.compile_set_aux(boost::re_de
tail::jstack<_STL::basic_string<char, _STL::char_traits<char>,
_STL::allocator<char> >, boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<_STL::basic_string<char, _STL::char_traits<char>,
_STL::allocator<char> >, boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<unsigned int, boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<_STL::basic_string<char, _STL::char_traits<char>,
_STL::allocator<char> >, boost::re_detail::jm_def_alloc> &, bool,
boost::re_detail::_wide_type const &)+0x181): undefined reference to
`boost::c_regex_traits<char>::transform(_STL::basic_string<char,
_STL::char_traits<char>, _STL::allocator<char> > &, _STL::basic_string<char,
_STL::char_traits<char>, _STL::allocator<char> > const &)'

reg.o(.boost::reg_expression<char, boost::regex_traits<char>,
boost::re_detail::jm_def_alloc>::gnu.linkonce.t.compile_set_aux(boost::re_de
tail::jstack<_STL::basic_string<char, _STL::char_traits<char>,
_STL::allocator<char> >, boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<_STL::basic_string<char, _STL::char_traits<char>,
_STL::allocator<char> >, boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<unsigned int, boost::re_detail::jm_def_alloc> &,
boost::re_detail::jstack<_STL::basic_string<char, _STL::char_traits<char>,
_STL::allocator<char> >, boost::re_detail::jm_def_alloc> &, bool,
boost::re_detail::_wide_type const &)+0x1da): undefined reference to
`boost::c_regex_traits<char>::transform(_STL::basic_string<char,
_STL::char_traits<char>, _STL::allocator<char> > &, _STL::basic_string<char,
_STL::char_traits<char>, _STL::allocator<char> > const &)'

reg.o: In function `boost::reg_expression<char, boost::regex_traits<char>,
boost::re_detail::jm_def_alloc>::compile_set(char const *&, char const *)':

reg.o(.boost::reg_expression<char, boost::regex_traits<char>,
boost::re_detail::jm_def_alloc>::gnu.linkonce.t.compile_set(char const *&,
char const *)+0x584): undefined reference to
`boost::c_regex_traits<char>::transform_primary(_STL::basic_string<char,
_STL::char_traits<char>, _STL::allocator<char> > &, _STL::basic_string<char,
_STL::char_traits<char>, _STL::allocator<char> > const &)'

reg.o: In function `char const * boost::re_detail::re_is_set_member<char
const *, char, boost::regex_traits<char>,
boost::re_detail::jm_def_alloc>(char const *, char const *,
boost::re_detail::re_set_long *, boost::reg_expression<char,
boost::regex_traits<char>, boost::re_detail::jm_def_alloc> const &)':

reg.o(.char const * boost::re_detail::gnu.linkonce.t.re_is_set_member<char
const *, char, boost::regex_traits<char>,
boost::re_detail::jm_def_alloc>(char const *, char const *,
boost::re_detail::re_set_long *, boost::reg_expression<char,
boost::regex_traits<char>, boost::re_detail::jm_def_alloc> const &)+0x260):
undefined reference to
`boost::c_regex_traits<char>::transform(_STL::basic_string<char,
_STL::char_traits<char>, _STL::allocator<char> > &, _STL::basic_string<char,
_STL::char_traits<char>, _STL::allocator<char> > const &)'

reg.o(.char const * boost::re_detail::gnu.linkonce.t.re_is_set_member<char
const *, char, boost::regex_traits<char>,
boost::re_detail::jm_def_alloc>(char const *, char const *,
boost::re_detail::re_set_long *, boost::reg_expression<char,
boost::regex_traits<char>, boost::re_detail::jm_def_alloc> const &)+0x35b):
undefined reference to
`boost::c_regex_traits<char>::transform_primary(_STL::basic_string<char,
_STL::char_traits<char>, _STL::allocator<char> > &, _STL::basic_string<char,
_STL::char_traits<char>, _STL::allocator<char> > const &)'

reg.o: In function
`boost::c_regex_traits<char>::lookup_collatename(_STL::basic_string<char,
_STL::char_traits<char>, _STL::allocator<char> > &, char const *, char const
*)':
reg.o(.boost::c_regex_traits<char>::gnu.linkonce.t.lookup_collatename(_STL::
basic_string<char, _STL::char_traits<char>, _STL::allocator<char> > &, char
const *, char const *)+0x3a): undefined reference to
`boost::re_detail::c_traits_base::do_lookup_collate(_STL::basic_string<char,
_STL::char_traits<char>, _STL::allocator<char> > &, char const *)'

collect2: ld returned 1 exit status

Any ideas?

Boris


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk