Boost logo

Boost Users :

Subject: [Boost-users] Undefined reference to boost_serialization even though it is specified with -lboost_serialization
From: Cedric Laczny (cedric.laczny_at_[hidden])
Date: 2011-02-24 05:14:39


Sorry, my bad. Hit "Send" before being finished...

So let's start again... I apologize.

Hi,

I have a program that uses serialization-functionality for some of the self-
defined classes.
I specify "-lboost_serialization" with the g++ and it works fine on my local
machine.
However, when I want to compile it on a remote machine, it fails. The remote
machine is lacking >=boost-1.42 which is needed. Therefore I built (no
install) boost-1.45 remotely (under /local/cedric/boost_1_45_0) and at least
the configure-script (generated using autotools) seems to detect all the
necessary libraries and headers (provided I specify them in the environment
variables), on my local machine aswell as on the remote machine.
Now the problem is, that I don't find the reason why it fails to compile my
program remotely...
Any ideas?

Here's the command used for linking:
/bin/bash ../libtool --tag=CXX --mode=link g++ -Wno-deprecated -g -O2 -
lboost_serialization -L/local/cedric/boost_1_45_0/stage/lib -o test test-
main.o ../includes/Parser/libparser.a -lgsl -lgslcblas -lm

and an excerpt of the error (taken from the end):

...
MicroCosmParser.cpp:
(.text._ZN5boost13serialization6detail17singleton_wrapperINS0_25extended_type_info_typeidI15MicroCosmParserEEED0Ev[boost::serialization::detail::singleton_wrapper<boost::serialization::extended_type_info_typeid<MicroCosmParser>
>::~singleton_wrapper()]+0x17): undefined reference to
`boost::serialization::detail::extended_type_info_typeid_0::type_unregister()'
MicroCosmParser.cpp:
(.text._ZN5boost13serialization6detail17singleton_wrapperINS0_25extended_type_info_typeidI15MicroCosmParserEEED0Ev[boost::serialization::detail::singleton_wrapper<boost::serialization::extended_type_info_typeid<MicroCosmParser>
>::~singleton_wrapper()]+0x1f): undefined reference to
`boost::serialization::detail::extended_type_info_typeid_0::~extended_type_info_typeid_0()'
MicroCosmParser.cpp:
(.text._ZN5boost13serialization6detail17singleton_wrapperINS0_25extended_type_info_typeidI15MicroCosmParserEEED0Ev[boost::serialization::detail::singleton_wrapper<boost::serialization::extended_type_info_typeid<MicroCosmParser>
>::~singleton_wrapper()]+0x39): undefined reference to
`boost::serialization::detail::extended_type_info_typeid_0::~extended_type_info_typeid_0()'
../includes/Parser/libparser.a(MicroCosmParser.o):
(.rodata._ZTVN5boost13serialization6detail17singleton_wrapperINS0_25extended_type_info_typeidI15MicroCosmParserEEEE[vtable
for
boost::serialization::detail::singleton_wrapper<boost::serialization::extended_type_info_typeid<MicroCosmParser>
>]+0x10): undefined reference to
`boost::serialization::detail::extended_type_info_typeid_0::is_less_than(boost::serialization::extended_type_info
const&) const'
../includes/Parser/libparser.a(MicroCosmParser.o):
(.rodata._ZTVN5boost13serialization6detail17singleton_wrapperINS0_25extended_type_info_typeidI15MicroCosmParserEEEE[vtable
for
boost::serialization::detail::singleton_wrapper<boost::serialization::extended_type_info_typeid<MicroCosmParser>
>]+0x18): undefined reference to
`boost::serialization::detail::extended_type_info_typeid_0::is_equal(boost::serialization::extended_type_info
const&) const'
../includes/Parser/libparser.a(MicroCosmParser.o):
(.rodata._ZTIN5boost13serialization25extended_type_info_typeidI15MicroCosmParserEE[typeinfo
for boost::serialization::extended_type_info_typeid<MicroCosmParser>]+0x18):
undefined reference to `typeinfo for
boost::serialization::detail::extended_type_info_typeid_0'
../includes/Parser/libparser.a(MicroCosmParser.o):
(.rodata._ZTVN5boost13serialization25extended_type_info_typeidI15MicroCosmParserEE[vtable
for boost::serialization::extended_type_info_typeid<MicroCosmParser>]+0x10):
undefined reference to
`boost::serialization::detail::extended_type_info_typeid_0::is_less_than(boost::serialization::extended_type_info
const&) const'
../includes/Parser/libparser.a(MicroCosmParser.o):
(.rodata._ZTVN5boost13serialization25extended_type_info_typeidI15MicroCosmParserEE[vtable
for boost::serialization::extended_type_info_typeid<MicroCosmParser>]+0x18):
undefined reference to
`boost::serialization::detail::extended_type_info_typeid_0::is_equal(boost::serialization::extended_type_info
const&) const'
collect2: ld returned 1 exit status

Best,

Cedric


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net