
Hi, I'm trying to use Boost regex for the first time and I'm having trouble getting libboost_regex to link. The libraries are in /usr/lib64 and I try adding -lboost_regex to CC command and also explicitly adding /usr/lib64/libboost_regex.so or .a but I keep getting the same linker errors whether the library is specified or not. I'm using Sun Studio 12. What am I doing wrong? Colin Running "/opt/sun/sunstudio12/bin/dmake -f Makefile CONF=Release" in /home/sparks/NovoCraft/ssp/novoalign dmake: defaulting to parallel mode. See the man page dmake(1) for more information on setting up the .dmakerc file. linuxpc --> 1 job /opt/sun/sunstudio12/bin/dmake -f nbproject/Makefile-Release.mk SUBPROJECTS= .build-conf linuxpc --> 1 job mkdir -p ../../sunbin CC -m64 -features=zla -staticlib=Cstd -staticlib=Crun --print-map
../../maps/novoalign.map -o ../../sunbin/novoalign build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/wmsearch.o build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/ksgroups.o build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/nawm.o build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/queryformat.o build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/queryfolder.o build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/keygen.o build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/ksindex.o build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/iubcodes.o build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/needle.o build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/TThread.o build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/shortnw.o build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/fragdist.o build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/novoparam.o build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/queryreader.o build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/posteriorP.o build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/qualconvert.o build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/TTimer.o build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/TThreadPool.o build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/rptsyncio.o build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/findamate.o build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/license.o build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/qryopt.o build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/novopaired_main.o /usr/lib64/libboost_regex.a -lpthread -lz /usr/lib64/libcrypto.a CC: Warning: Option --print-map passed to ld, if ld is invoked, ignored otherwise (/home/sparks/NovoCraft/ssp/novoalign)build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/wmsearch.o: . . .:(/home/sparks/NovoCraft/ssp/novoalign)build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/novopaired_main.o (/home/sparks/NovoCraft/ssp/novoalign)/usr/lib64/libboost_regex.a: :(/home/sparks/NovoCraft/ssp/novoalign)/usr/lib64/libboost_regex.a (/home/sparks/NovoCraft/ssp/novoalign)/usr/lib64/libcrypto.a: :(/home/sparks/NovoCraft/ssp/novoalign)/usr/lib64/libcrypto.a build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/ksgroups.o: In function `void boost::re_detail::basic_regex_parser<char,boost::regex_traits<char,boost::cpp_regex_traits<char>
::parse(const char*,const char*,unsigned)': ksgroups.cc:(.text%void boost::re_detail::basic_regex_parser<char,boost::regex_traits<char,boost::cpp_regex_traits<char> ::parse(const char*,const char*,unsigned)[void boost::re_detail::basic_regex_parser<char,boost::regex_traits<char,boost::cpp_regex_traits<char> ::parse(const char*,const char*,unsigned)]+0x28e): undefined reference to `void boost::re_detail::raw_storage::resize(unsigned long)' ksgroups.cc:(.text%void boost::re_detail::basic_regex_parser<char,boost::regex_traits<char,boost::cpp_regex_traits<char> ::parse(const char*,const char*,unsigned)[void boost::re_detail::basic_regex_parser<char,boost::regex_traits<char,boost::cpp_regex_traits<char> ::parse(const char*,const char*,unsigned)]+0x2f8): undefined reference to `void boost::re_detail::raw_storage::resize(unsigned long)' build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/ksgroups.o: In function `bool boost::re_detail::perl_matcher<const char*,std::allocator<boost::sub_match<const char*> ,boost::regex_traits<char,boost::cpp_regex_traits<char> > >::match()': ksgroups.cc:(.text%bool boost::re_detail::perl_matcher<const char*,std::allocator<boost::sub_match<const char*> ,boost::regex_traits<char,boost::cpp_regex_traits<char> > >::match()[bool boost::re_detail::perl_matcher<const char*,std::allocator<boost::sub_match<const char*> ,boost::regex_traits<char,boost::cpp_regex_traits<char> > ::match()]+0x17): undefined reference to `void*boost::re_detail::get_mem_block()' ksgroups.cc:(.text%bool boost::re_detail::perl_matcher<const char*,std::allocator<boost::sub_match<const char*> ,boost::regex_traits<char,boost::cpp_regex_traits<char> > >::match()[bool boost::re_detail::perl_matcher<const char*,std::allocator<boost::sub_match<const char*> ,boost::regex_traits<char,boost::cpp_regex_traits<char> > ::match()]+0x128): undefined reference to `void boost::re_detail::verify_options(unsigned,boost::regex_constants::_match_flags)' ksgroups.cc:(.text%bool boost::re_detail::perl_matcher<const char*,std::allocator<boost::sub_match<const char*> ,boost::regex_traits<char,boost::cpp_regex_traits<char> > >::match()[bool boost::re_detail::perl_matcher<const char*,std::allocator<boost::sub_match<const char*> ,boost::regex_traits<char,boost::cpp_regex_traits<char> > ::match()]+0x186): undefined reference to `void boost::re_detail::put_mem_block(void*)' ksgroups.cc:(.text%bool boost::re_detail::perl_matcher<const char*,std::allocator<boost::sub_match<const char*> ,boost::regex_traits<char,boost::cpp_regex_traits<char> > >::match()[bool boost::re_detail::perl_matcher<const char*,std::allocator<boost::sub_match<const char*> ,boost::regex_traits<char,boost::cpp_regex_traits<char> > ::match()]+0x1a3): undefined reference to `void boost::re_detail::put_mem_block(void*)' ksgroups.cc:(.text%bool boost::re_detail::perl_matcher<const char*,std::allocator<boost::sub_match<const char*> ,boost::regex_traits<char,boost::cpp_regex_traits<char> > >::match()[bool boost::re_detail::perl_matcher<const char*,std::allocator<boost::sub_match<const char*> ,boost::regex_traits<char,boost::cpp_regex_traits<char> > ::match()]+0x1ff): undefined reference to `void boost::re_detail::put_mem_block(void*)' ksgroups.cc:(.text%bool boost::re_detail::perl_matcher<const char*,std::allocator<boost::sub_match<const char*> ,boost::regex_traits<char,boost::cpp_regex_traits<char> > >::match()[bool boost::re_detail::perl_matcher<const char*,std::allocator<boost::sub_match<const char*> ,boost::regex_traits<char,boost::cpp_regex_traits<char> > ::match()]+0x230): undefined reference to `void boost::re_detail::put_mem_block(void*)' build/Release/Sun12-Linux-x86/_ext/home/sparks/NovoCraft/ssp/novoalign/../../src/ksgroups.o: In function `boost::shared_ptr<boost::re_detail::cpp_regex_traits_implementation<char> boost::object_cache<boost::re_detail::cpp_regex_traits_base<char>,boost::re_detail::cpp_regex_traits_implementation<char> ::do_get(const boost::re_detail::cpp_regex_traits_base<char>&,unsigned long)': ksgroups.cc:(.text%boost::shared_ptr<boost::re_detail::cpp_regex_traits_implementation<char> boost::object_cache<boost::re_detail::cpp_regex_traits_base<char>,boost::re_detail::cpp_regex_traits_implementation<char> ::do_get(const boost::re_detail::cpp_regex_traits_base<char>&,unsigned long)[boost::shared_ptr<boost::re_detail::cpp_regex_traits_implementation<char>

I'm trying to use Boost regex for the first time and I'm having trouble getting libboost_regex to link.
The libraries are in /usr/lib64 and I try adding -lboost_regex to CC command and also explicitly adding /usr/lib64/libboost_regex.so or .a but I keep getting the same linker errors whether the library is specified or not.
I'm using Sun Studio 12.
What am I doing wrong?
My guess is that you have different compiler options specified for the application you're building and for the libboost_regex.so, a likely candidate is that bjam will build Boost.Regex with the -library=stlport4 option, where as you're application isn't? HTH, John.

Hi John, Thanks for the reply, I've already changed my code to use regex.h from standard C library and it's working so I'll stick with it now. I never knew about that option and always just compiled with default library. It may explain why my 3 or 4 attempts to use Boost have never worked. I'll give it another try when I have some spare time. Thanks again, Colin On Fri, Feb 20, 2009 at 1:02 AM, John Maddock <john@johnmaddock.co.uk>wrote:
I'm trying to use Boost regex for the first time and I'm having trouble
getting libboost_regex to link.
The libraries are in /usr/lib64 and I try adding -lboost_regex to CC command and also explicitly adding /usr/lib64/libboost_regex.so or .a but I keep getting the same linker errors whether the library is specified or not.
I'm using Sun Studio 12.
What am I doing wrong?
My guess is that you have different compiler options specified for the application you're building and for the libboost_regex.so, a likely candidate is that bjam will build Boost.Regex with the -library=stlport4 option, where as you're application isn't?
HTH, John.
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Colin Hercus
-
John Maddock