beginners problems linking serialization library

I am having problems linking a program using the serialization library. I have made a small program, considerably simpler than the demo.cpp listed at http://www.boost.org/libs/serialization/doc/tutorial.html and I have also tried linking demo.cpp itself. My hpp files are in /home/mshapiro.local/boost/include/boost-1_32/boost/ My libraries are in /home/mshapiro.local/boost/lib/ I have tried linking this code with gcc 3.4.5 on a linux machine using gcc -I/home/mshapiro.local/boost/include/boost-1_32/ \ -L/home/mshapiro.local/boost/lib/ \ -lboost_serialization-gcc \ demo.cpp I have tried many variations on this! (For example, I have tried g++ instead of gcc, I have tried all variations on the serialization library, such as boost_serialization-gcc-d-1_32, etc, I have tried turning off warnings as suggested in the compiler specific issues.) I can compile using the -c flag, but I cannot link it. I get a large number of error messages all of which look much like /tmp/ccuSnkzu.o(.gnu.linkonce.t._ZN5boost7archive18text_oarchive_implINS0_13text_oarchiveEED1Ev+0x51): In function `boost::archive::text_oarchive_impl<boost::archive::text_oarchive>::~text_oarchive_impl()': : undefined reference to `boost::archive::basic_text_oprimitive<std::basic_ostream<char, std::char_traits<char> > >::~basic_text_oprimitive()' I can find various references to this exact problem in the newsgroups, but can find no solution to it. Your help would be greatly appreciated. Many thanks in advance, Michael Shapiro

Hi Michael, Most likely your problem is that the LD_LIBRARY_PATH does not have the boost build directory in it. On the commandline write: export LD_LIBRARY_PATH=/home/mshapiro.local/boost/lib/ :$LD_LIBRARY_PATH Hope this helps. Regards, Andreas Saebjoernsen On 1/23/06, Michael Shapiro <mshapiro@vbi.vt.edu> wrote:
I am having problems linking a program using the serialization library.
I have made a small program, considerably simpler than the demo.cpp listed at http://www.boost.org/libs/serialization/doc/tutorial.html and I have also tried linking demo.cpp itself.
My hpp files are in /home/mshapiro.local/boost/include/boost-1_32/boost/
My libraries are in /home/mshapiro.local/boost/lib/
I have tried linking this code with gcc 3.4.5 on a linux machine using
gcc -I/home/mshapiro.local/boost/include/boost-1_32/ \ -L/home/mshapiro.local/boost/lib/ \ -lboost_serialization-gcc \ demo.cpp
I have tried many variations on this! (For example, I have tried g++ instead of gcc, I have tried all variations on the serialization library, such as boost_serialization-gcc-d-1_32, etc, I have tried turning off warnings as suggested in the compiler specific issues.) I can compile using the -c flag, but I cannot link it. I get a large number of error messages all of which look much like
/tmp/ccuSnkzu.o(.gnu.linkonce.t._ZN5boost7archive18text_oarchive_implINS0_13text_oarchiveEED1Ev+0x51): In function
`boost::archive::text_oarchive_impl<boost::archive::text_oarchive>::~text_oarchive_impl()': : undefined reference to `boost::archive::basic_text_oprimitive<std::basic_ostream<char, std::char_traits<char> > >::~basic_text_oprimitive()'
I can find various references to this exact problem in the newsgroups, but can find no solution to it.
Your help would be greatly appreciated.
Many thanks in advance, Michael Shapiro
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users

Michael Shapiro wrote:
I am having problems linking a program using the serialization library.
I have made a small program, considerably simpler than the demo.cpp listed at http://www.boost.org/libs/serialization/doc/tutorial.html and I have also tried linking demo.cpp itself.
My hpp files are in /home/mshapiro.local/boost/include/boost-1_32/boost/
My libraries are in /home/mshapiro.local/boost/lib/
I have tried linking this code with gcc 3.4.5 on a linux machine using
gcc -I/home/mshapiro.local/boost/include/boost-1_32/ \ -L/home/mshapiro.local/boost/lib/ \ -lboost_serialization-gcc \ demo.cpp
I see no reference to a specific library here - could a gcc expert comment here? On my system - windows XP professional the library name is libboost_serialization-gcc-d-1_33_1 So I would expect to use that as the argumetn for the -l switch above. It might be different in your case. Robert Ramey

Hi, I have a question regarding public virtual base class, how am I going to serialize this since inheritance from 2 classes only permits saving one copy of the base class. Robert Ramey <ramey@rrsd.com> wrote: Michael Shapiro wrote:
I am having problems linking a program using the serialization library.
I have made a small program, considerably simpler than the demo.cpp listed at http://www.boost.org/libs/serialization/doc/tutorial.html and I have also tried linking demo.cpp itself.
My hpp files are in /home/mshapiro.local/boost/include/boost-1_32/boost/
My libraries are in /home/mshapiro.local/boost/lib/
I have tried linking this code with gcc 3.4.5 on a linux machine using
gcc -I/home/mshapiro.local/boost/include/boost-1_32/ \ -L/home/mshapiro.local/boost/lib/ \ -lboost_serialization-gcc \ demo.cpp
I see no reference to a specific library here - could a gcc expert comment here? On my system - windows XP professional the library name is libboost_serialization-gcc-d-1_33_1 So I would expect to use that as the argumetn for the -l switch above. It might be different in your case. Robert Ramey _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users --------------------------------- Yahoo! Photos Got holiday prints? See all the ways to get quality prints in your hands ASAP.

Look at test_mi (multiple inheritence). Its pretty straight forward. If you want to be sure that virtual base classes are saved only once - just make sure that they are tracked. Look up tracking in the serialization traits part of the documentation Robert Ramey "sui tam" <suitam2006@yahoo.com> wrote in message news:20060124005935.16399.qmail@web36304.mail.mud.yahoo.com... Hi, I have a question regarding public virtual base class, how am I going to serialize this since inheritance from 2 classes only permits saving one copy of the base class.
participants (4)
-
Andreas Sæbjørnsen
-
Michael Shapiro
-
Robert Ramey
-
sui tam