I have a similiar linux system to what you describe. I found that I needed to modify the Jamfile in $BOOST_ROOT/libs/serialization/example in order to build these files. Two changes: 1. Added demo_pimpl_A.cpp 2. Added libpthread.a The modified Jamfile is included. Maximilian Wilson wrote:
I'm using gcc v 3.3, Red Hat Linux (not sure what version), and Boost 1.32. I'm trying to learn the serialization library, using the demo program from http://boost.org/libs/serialization/example/demo.cpp .
I have had a little bit of trouble figuring out the boost install procedure for this library but I think I finally did it with:
bjam "-sTOOLS=gcc" install --libdir=/home/max/boost --includedir=/home/max/boost -with-serialization
But when I execute "g++ -I/home/max/boost/boost-1_32 -L/home/max/boost demo.cpp demo.o" I get a bunch of linker errors. I'm pretty sure I've messed up this install procedure somewhere, and the Boost docs have tentalizing references to serialization not having "automatic linking," but I can't figure out where to go next. What am I doing wrong?
Max Wilson
# Boost serialization Library Build Jamfile
# (C) Copyright Robert Ramey 2002-2004.
# Use, modification, and distribution are subject to the
# Boost Software License, Version 1.0. (See accompanying file
# LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
#
# See http://www.boost.org/libs/serialization for the library home page.
subproject libs/serialization/example ;
rule demo-bsl-build ( demo-name )
{
exe $(demo-name)
: # sources
$(demo-name).cpp
demo_pimpl_A.cpp
<lib>../build/boost_serialization
: # requirements
<library-file>/usr/lib/libpthread.a
<include>$(BOOST_ROOT)
<sysinclude>$(BOOST_ROOT)
<borland><*><cxxflags>-w-8080
<msvc><release><cxxflags>-Gy
<vc7><release><cxxflags>-Gy