Boost logo

Boost Users :

Subject: Re: [Boost-users] link error on serialization demo.cpp
From: Robert Jones (robertgbjones_at_[hidden])
Date: 2010-10-16 15:48:09


On Fri, Oct 15, 2010 at 7:41 PM, <jiryih.tsaur_at_[hidden]> wrote:

> Tried to compile demo.cpp and getting link error below. Any suggestions?
>
> g++ -c -I. -I/usr/include -I/usr/include/c++/4.1.2 -I/usr/include/boost
> -I/home/jitsaur/usr/include -g -D_DEBUG -o demo.o demo.cpp
>
> g++ -I. -I/usr/include -I/usr/include/c++/4.1.2 -I/usr/include/boost
> -I/home/jitsaur/usr/include -g -D_DEBUG -o demo demo.o
>
> demo.o: In function `archive_exception':
>
> /home/jitsaur/usr/include/boost/archive/archive_exception.hpp:45: undefined
> reference to `vtable for boost::archive::archive_exception'
>
>
I don't know the answer to this, but here's some thoughts...

Serialization (from which archive_exception probably arises) is one of the
few non-header-only libraries, so
you must have built the library and have it somewhere it will be pickup by
the link line. The library must also
be mentioned in the link line.

All the -I directives in the second line are presumably redundant? I don't
think it matters that they're there tho'.

Maybe try gcc instead of g++ for the link line. I can't recall the details,
and this may produce reems of missing
standard library symbol errors, but IIRC g++ and gcc link different
libraries. (This point may be completely the
wrong way round!)

HTH, I'd be inclined to point the finger at the first point. Oh, and read
through the getting started guide and make
sure all the steps have been followed, or at least that all the build
products are present.

- Rob.



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