blackberry / Boost

The Boost C++ Libraries
Boost Software License 1.0
230 stars 122 forks source link

boost_regex undefined reference to #9

Open Filipe-Figueiredo opened 10 years ago

Filipe-Figueiredo commented 10 years ago

Hi,

I compiled successfully (I guess...) Boost for BB10, but when my program is linking, I get the next 3 errors:

In function `bool boost::regex_match<gnu_cxx::normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<gnu_cxx::normal_iterator<char const, std::string> > >, char, boost::regex_traits<char, boost::cpp_regex_traits > >(__gnu_cxx::__normal_iterator<char const, std::string>, gnu_cxx::normal_iterator<char const*, std::string>, boost::match_results<gnu_cxx::normal_iterator<char const, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const, std::string> > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits > > const&, boost::regex_constants::_match_flags)':

/build/bb10/out/Default/../../../../sdk/bb10/include/boost/regex/v4/regex_match.hpp:50: undefined reference to `boost::re_detail::perl_matcher<gnu_cxx::normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<gnu_cxx::normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits > >::match()'


In function perl_matcher': /build/bb10/out/Default/../../../../sdk/bb10/include/boost/regex/v4/perl_matcher.hpp:371: undefined reference toboost::re_detail::perl_matcher<gnu_cxx::normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<gnu_cxx::normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits > > const&, boost::regex_constants::_match_flags)'


In function bool boost::regex_search<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > >, char, boost::regex_traits<char, boost::cpp_regex_traits<char> > >(__gnu_cxx::__normal_iterator<char const*, std::string>, __gnu_cxx::__normal_iterator<char const*, std::string>, boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<__gnu_cxx::__normal_iterator<char const*, std::string> > > >&, boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags, __gnu_cxx::__normal_iterator<char const*, std::string>)': /build/bb10/out/Default/../../../../sdk/bb10/include/boost/regex/v4/regex_search.hpp:56: undefined reference toboost::re_detail::perl_matcher<gnu_cxx::normal_iterator<char const*, std::string>, std::allocator<boost::sub_match<gnu_cxx::normal_iterator<char const*, std::string> > >, boost::regex_traits<char, boost::cpp_regex_traits > >::find()'

I have static library of boost_regex included in my ldflags, but header files can't access these functions.

At this point, I am thinking that maybe this is an issue of Boost, and the .a file doesn't contain the referred function.

Do you know anything about this?

Thanks in advance

Filipe-Figueiredo commented 10 years ago

I've fixed it! The problem was in blackberry-config.jam, I was using dinkunware instead of gnu std::.

tvaneerd commented 10 years ago

I wonder if boost regex assumes gnu::std whenever using gcc as the compiler. Which would be unfortunate. :-(

From: Filipe-Figueiredo [mailto:notifications@github.com] Sent: Monday, December 09, 2013 2:37 PM To: blackberry/Boost Subject: Re: [Boost] boost_regex undefined reference to (#9)

I've fixed it! The problem was in blackberry-config.jam, I was using dinkunware instead of gnu std::.

Reply to this email directly or view it on GitHubhttps://github.com/blackberry/Boost/issues/9#issuecomment-30165521.

This transmission (including any attachments) may contain confidential information, privileged material (including material protected by the solicitor-client or other applicable privileges), or constitute non-public information. Any use of this information by anyone other than the intended recipient is prohibited. If you have received this transmission in error, please immediately reply to the sender and delete this information from your system. Use, dissemination, distribution, or reproduction of this transmission by unintended recipients is not authorized and may be unlawful.

Filipe-Figueiredo commented 10 years ago

I am with another problem now, and I think it's because of this..

Now I am linking the libraries to my BlackBerry project (that uses the GNU C ++ runtime instead of the Dinkumware runtime).

I am using

include <boost/tokenizer.hpp>

boost::char_separator charSep("|"); boost::tokenizerboost::char_separator tok(is, charSep);

The code runs well, but when I close the application I get

Process 395419898 (test_application) terminated SIGSEGV code=1 fltno=11 ip=78143a76(/base/lib/libstdc++.so.6.0.16@_ZNSt6localeD1Ev+0xd) mapaddr=00053a76. ref=00000000 bdslot=1

I think this has to do with boost compilation, because this is the only code on my project (not counting with hello world standard code).