Boost logo

Boost Users :

From: Demos Rali (demorali_at_[hidden])
Date: 2006-03-01 19:21:50


Hello,

I am having difficulties statically compiling the demo program at
http://www.boost.org/libs/serialization/example/demo.cpp
on Linux (Linux 2.6.15-1.1831_FC4 #1 SMP Tue Feb 7 13:37:59 EST 2006
x86_64 GNU/Linux) with gcc version 4.0.2 20051125.

When I try:
g++ -o demo -I /path/boost/ -L /path/boost/ -lboost_serialization demo.cpp

it works fine, but I get a program which needs dynamic versions of the
serialization library.

However, I would like to compile against the static versions of
the Boost.Serialization library.

If I try
g++ -static -o demo -I /path/boost/ -L /path/boost/ -lboost_serialization demo.cpp

the linker complains of a lot of undefined references, like

/tmp/ccFAJsqB.o(.gnu.linkonce.r._ZTIN5boost13serialization16void_cast_detail21void_caster_primitiveIK20bus_stop_destinationK8bus_stopEE[typeinfo
for
boost::serialization::void_cast_detail::void_caster_primitive<bus_stop_destination
const, bus_stop const>]+0x10): undefined reference to `typeinfo for
boost::serialization::void_cast_detail::void_caster'
...

I have no difficulties when statically linking against other boost
libraries. I built the librairies with gcc, with no exotic options.

Any suggestions would be greatly appreciated.

Thanks a lot.

Fabrizio


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