linking error while using Boost-regex and Stlport in the same project
______________________________________________________________________
::maybe_assign(boost::match_results<char const*, stlp_std::allocator<boost::sub_match<char const*> > > const&)'
(boost::regex_traits_wrapper<boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::error _type)': : undefined reference to `boost::re_detail::raise_runtime_error(stlp_std::runtime _error const&)'
Hi, I'm working on a project which needs both boost-regex, and STLPORT. When these two libraries are used individually for some sample examples, they work fine. But when used both in the same project, I get linking errors as follows: main/main.cpp:6: instantiated from here /home/kpendyal/software/STLport-5.1.5/stlport/stl/_algobase.c:374: warning: unused parameter '__comp2' /usr/bin/ld: warning: libstdc++.so.5, needed by /home/kpendyal/software/xerces-c_2_8_0/lib/libxerces-c.so, may conflict with libstdc++.so.6 main/main.o(.gnu.linkonce.t._ZN5boost9re_detail12perl_matcherIPKcN8stlp_ std9allocatorINS_9sub_matchIS3_EEEENS_12regex_traitsIcNS_16cpp_regex_ traitsIcEEEEE11match_matchEv+0xa3): In function `boost::re_detail::perl_matcher<char const*, stlp_std::allocator<boost::sub_match<char const*> >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::match_match()': : undefined reference to `boost::match_results<char const*, stlp_std::allocator<boost::sub_match<char const*> > main/main.o(.gnu.linkonce.t._ZN5boost12regex_searchIPKcN8stlp_ std9allocatorINS_9sub_matchIS2_EEEEcNS_12regex_traitsIcNS_16cpp_ regex_traitsIcEEEEEEbT_SC_RNS_13match_resultsISC_T0_EERKNS_11basic_ regexIT1_T2_EENS_15regex_constants12_match_flagsESC_+0x8e): In function `bool boost::regex_search<char const*, stlp_std::allocator<boost::sub_match<char const*> >, char, boost::regex_traits<char, boost::cpp_regex_ traits<char> > >(char const*, char const*, boost::match_results<char const*, stlp_std::allocator<boost::sub_match<char const*> > >&, boost::basic_ regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags, char const*)': : undefined reference to `boost::re_detail::perl_matcher<char const*, stlp_std::allocator<boost::sub_match<char const*> >, boost::regex_traits<char, boost::cpp_regex_traits<char> > >::construct_init(boost::basic_regex<char, boost::regex_traits<char, boost::cpp_regex_traits<char> > > const&, boost::regex_constants::_match_flags)' main/main.o(.gnu.linkonce.t._ZN5boost9re_detail11raise_errorINS_ 20regex_traits_wrapperINS_12regex_traitsIcNS_16cpp_regex_ traitsIcEEEEEEEEvRKT_NS_15regex_constants10error_typeE+0xa3): In function `void boost::re_detail::raise_error<boost::regex_traits_wrapper<boost::regex_ traits<char, boost::cpp_regex_traits<char> > > main/main.o(.gnu.linkonce.t._ZN5boost9re_detail18basic_regex _parserIcNS_12regex_traitsIcNS_16cpp_regex_traitsIcEEEEE4failENS_ 15regex_constants10error_typeEi+0x108): In function `boost::re_detail::basic_regex_parser<char, boost::regex_traits<char, boost::cpp_regex_traits<char> >
::fail(boost::regex_constants::error_type, int)': : undefined reference to `boost::regex_error::regex_error(stlp_std::basic_string<char, stlp_std::char_traits<char>, stlp_std::allocator<char> > const&, boost::regex_constants::error_type, int)'
collect2: ld returned 1 exit status make: *** [ctoolkit] Error 1
______________________________________________________________________
I tried to build boost with STLPORT, but never could get the library with '-p' in it's name, which I suppose is required here. How can I get it, or is there some other way???? Please help asap...
AMDG ashish wrote:
I'm working on a project which needs both boost-regex, and STLPORT. When these two libraries are used individually for some sample examples, they work fine. But when used both in the same project, I get linking errors as follows:
<snip> I tried to build boost with STLPORT, but never could get the library with '-p' in it's name, which I suppose is required here. How can I get it, or is there some other way????
What exactly did you try? The correct command is bjam stdlib=stlport ... In Christ, Steven Watanabe
Steven Watanabe-4 wrote:
AMDG
What exactly did you try? The correct command is
bjam stdlib=stlport ...
I'm working on linux with gcc. Initially I installed Boost with normal settings with gcc.make file, from /app/home/alahane1/boost_1_37_0/libs/regex/build which gave those linking errors. Then I tried bjam -sTOOLS=gcc-stlport --toolset=gcc -sstdlib=stlport --with-regex --build-type=complete -a stage with proper include and lib paths given in file 'user-config.jam' as follows: ----------------------------------------------------- # Copyright 2003, 2005 Douglas Gregor # Copyright 2004 John Maddock # Copyright 2002, 2003, 2004, 2007 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt) # This file is used to configure your Boost.Build installation. You can modify # this file in place, or you can place it in a permanent location so that it # does not get overwritten should you get a new version of Boost.Build. See: # # http://boost.org/boost-build2/doc/html/bbv2/reference.html#bbv2.reference.in... # # for documentation about possible permanent locations. # This file specifies which toolsets (C++ compilers), libraries, and other # tools are available. Often, you should be able to just uncomment existing # example lines and adjust them to taste. The complete list of supported tools, # and configuration instructions can be found at: # # http://boost.org/boost-build2/doc/html/bbv2/reference/tools.html # # This file uses Jam language syntax to describe available tools. Mostly, # there are 'using' lines, that contain the name of the used tools, and # parameters to pass to those tools -- where paremeters are separated by # semicolons. Important syntax notes: # # - Both ':' and ';' must be separated from other tokens by whitespace # - The '\' symbol is a quote character, so when specifying Windows paths you # should use '/' or '\\' instead. # # More details about the syntax can be found at: # # http://boost.org/boost-build2/doc/html/bbv2/advanced.html#bbv2.advanced.jam_... # # ------------------ # GCC configuration. # ------------------ # Configure gcc (default version). using gcc ; # Configure specific gcc version, giving alternative name to use. # using gcc : 3.2 : g++-3.2 ; # ------------------- # MSVC configuration. # ------------------- # Configure msvc (default version, searched for in standard locations and PATH). # using msvc ; # Configure specific msvc version (searched for in standard locations and PATH). # using msvc : 8.0 ; # ---------------------- # Borland configuration. # ---------------------- # using borland ; # ---------------------- # STLPort configuration. # ---------------------- # Configure specifying location of STLPort headers. Libraries must be either # not needed or available to the compiler by default. # using stlport : : /usr/include/stlport ; # Configure specifying location of both headers and libraries explicitly. using stlport : : /app/home/kpendyal/STLport-5.1.5/stlport /app/home/kpendyal/STLport-5.1.5/lib ; # ----------------- # QT configuration. # ----------------- # Configure assuming QTDIR gives the installation prefix. # using qt ; # Configure with an explicit installation prefix. # using qt : /usr/opt/qt ; ----------------------------------------------------- Still couldn't get rid of those errors. I'm not confident that this step which I did, was it correct or was there some small thing missing. But even bjam didnt give any error message. Does it mean whatever I did is right? But then it also didnt produce any library with '-p'. -- View this message in context: http://www.nabble.com/linking-error-while-using-Boost-regex-and-Stlport-in-t... Sent from the Boost - Users mailing list archive at Nabble.com.
Steven Watanabe-4 wrote:
bjam stdlib=stlport ...
Thanx alot. It's working now. Actually, I had tried bjam -sstdlib=stlport ..... But now tried as u said, I got the '-p' library, which when used with my project worked fine. Thanx alot again. -- View this message in context: http://www.nabble.com/linking-error-while-using-Boost-regex-and-Stlport-in-t... Sent from the Boost - Users mailing list archive at Nabble.com.
ashish wrote:
Hi,
I'm working on a project which needs both boost-regex, and STLPORT. When these two libraries are used individually for some sample examples, they work fine. But when used both in the same project, I get linking errors as follows:
You need to check that: * The regex library was built against STLport. * The build options you are using (for example __STL_DEBUG settings) match what you used to build the regex lib. HTH, John.
John Maddock wrote:
You need to check that:
* The regex library was built against STLport.
I've tried to build regex with STLPORT, but not sure that did I do it right. In another reply I've mentioned what I tried. Can you please tell me the exact steps...... John Maddock wrote:
* The build options you are using (for example __STL_DEBUG settings) match what you used to build the regex lib.
Being a newbie, I'm not aware of these options. Can u plz enlighten me on these???? -Ashish -- View this message in context: http://www.nabble.com/linking-error-while-using-Boost-regex-and-Stlport-in-t... Sent from the Boost - Users mailing list archive at Nabble.com.
I've tried to build regex with STLPORT, but not sure that did I do it right. In another reply I've mentioned what I tried. Can you please tell me the exact steps......
Well... since you've used the makefile already, try something like: export CXXFLAGS=-Ipath-to-stlport-include export LDFLAGS=STLPort-link-options make -B
* The build options you are using (for example __STL_DEBUG settings) match what you used to build the regex lib.
Being a newbie, I'm not aware of these options. Can u plz enlighten me on these????
They alter STLPort and add additional debugging support - refer to the STLPort docs for more info. HTH, John.
John Maddock wrote:
Well... since you've used the makefile already, try something like:
export CXXFLAGS=-Ipath-to-stlport-include export LDFLAGS=STLPort-link-options make -B
Tried, still not working. Same errors. I couldn't get the library with name libboost_regex-gcc42-mt-p-1_37.a or libboost_regex-gcc42-mt-p-1_37.so Notice the '-p' in it. Is it that these libraries mean Boost compiled with STLPORT? Is it what I will need to link my project code with? John Maddock wrote:
They alter STLPort and add additional debugging support - refer to the STLPort docs for more info.
I checked debug options, I think I have debug options off in both, in STLPORT as well as in BOOST, as I've not explicitly made those options on. Just to remind, whenever I use regex-boost alone for some toy example, it doesn't give any errors. I'm also using Xerces, ACE, XQUILLA, XALAN, XSD libraries in the same project. May some of these be the cause of this trouble? -- View this message in context: http://www.nabble.com/linking-error-while-using-Boost-regex-and-Stlport-in-t... Sent from the Boost - Users mailing list archive at Nabble.com.
Ashish Lahane wrote:
John Maddock wrote:
Well... since you've used the makefile already, try something like:
export CXXFLAGS=-Ipath-to-stlport-include export LDFLAGS=STLPort-link-options make -B
Tried, still not working. Same errors. I couldn't get the library with name libboost_regex-gcc42-mt-p-1_37.a or libboost_regex-gcc42-mt-p-1_37.so Notice the '-p' in it. Is it that these libraries mean Boost compiled with STLPORT? Is it what I will need to link my project code with?
The "-p" is placed in the name if you build with bjam and stlport, not from the makefile.
Just to remind, whenever I use regex-boost alone for some toy example, it doesn't give any errors. I'm also using Xerces, ACE, XQUILLA, XALAN, XSD libraries in the same project. May some of these be the cause of this trouble?
Nope, last try: regex is "just a bunch of sources", they're located in libs/regex/src. So you can either add those directly to your project, or build them into a library from your IDE using the same build settings as the rest of your project. HTH, John.
participants (4)
-
ashish
-
Ashish Lahane
-
John Maddock
-
Steven Watanabe