Link error Boost.Serialization
Hi, i want to use serialization library from boost. I'm enthused about the functionality. But when i try to compile and link the first example (which can be find on http://www.boost.org/libs/serialization/doc/index.html), i get the following error messages: (with g++ -o serialize serialize.cpp -lboost_serialization-gcc -I/usr/local/include/boost-1_32) "/usr/local/lib/gcc/x86_64-unknown-linux-gnu/3.4.3/../../../libboost_serialization-gcc.a(basic_iarchive.o)(.text+0x1ef): Infunction `boost::archive::detail::basic_iarchive::~basic_iarchive()': : undefined reference to `std::__default_alloc_template::_S_force_new' /usr/local/lib/gcc/x86_64-unknown-linux-gnu/3.4.3/../../../libboost_serialization-gcc.a(basic_iarchive.o)(.text+0x254): Infunction `boost::archive::detail::basic_iarchive::~basic_iarchive()': : undefined reference to `std::__default_alloc_template::_S_force_new' /usr/local/lib/gcc/x86_64-unknown-linux-gnu/3.4.3/../../../libboost_serialization-gcc.a(basic_iarchive.o)(.text+0x279): Infunction `boost::archive::detail::basic_iarchive::~basic_iarchive()': .... (~ 10 Pages) " And with "g++ -o serialize serialize.cpp -lboost_serialization-gcc -I/usr/local/include/boost-1_32 -lboost_thread-gcc-mt" only: "`.gnu.linkonce.t._ZNK5boost7archive17archive_exception4whatEv' referenced in section `.rodata' of /usr/local/lib/gcc/x86_64-unknown-linux-gnu/3.4.3/../../../libboost_serialization-gcc.a(basic_iarchive.o): defined in discarded section `.gnu.linkonce.t._ZNK5boost7archive17archive_exception4whatEv' of /usr/local/lib/gcc/x86_64-unknown-linux-gnu/3.4.3/../../../libboost_serialization-gcc.a(basic_iarchive.o) " I use Boost at first time and i'm going to despair.. Maybe it is important: i have installed Boost with gcc 3.4.3 on SuSE 9.2 (x86_64). With gcc 3.3.4 similar error message occur (g++ -o serialize serialize.cpp -lboost_serialization-gcc -I/usr/local/include/boost-1_32 ): "`.gnu.linkonce.t._ZNK5boost7archive17archive_exception4whatEv' referenced in section `.rodata' of /usr/local/lib/libboost_serialization-gcc.a(basic_iarchive.o): defined in discarded section `.gnu.linkonce.t._ZNK5boost7archive17archive_exception4whatEv' of /usr/local/lib/libboost_serialization-gcc.a(basic_iarchive.o) " Thank you for help! Christian _________________________________________________________________________ Mit der Grupppen-SMS von WEB.DE FreeMail können Sie eine SMS an alle Freunde gleichzeitig schicken: http://freemail.web.de/features/?mc=021179
On Wed, 30 Mar 2005 13:06:32 +0100, Christian Heinemann wrote
Hi, i want to use serialization library from boost. I'm enthused about the functionality. But when i try to compile and link the first example (which can be find on http://www.boost.org/libs/serialization/doc/index.html), i get the following error messages: (with g++ -o serialize serialize.cpp -lboost_serialization-gcc -I/usr/local/include/boost-1_32)
It doesn't look like you've told the compiler where to find the serialization library. You probably need the option: -L /usr/local/lib assuming that's where the serialization library is installed. HTH, Jeff
participants (2)
-
Christian Heinemann
-
Jeff Garland