Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2006-02-27 11:51:25


"RIVASSEAU Jean Noel" <JN.RIVASSEAU_at_[hidden]> wrote in message
news:87F60F7FA02FF749AFB02BD9FCAA6B04DA7774_at_naserv31.nanterre.oberthurcs.com...

Hello Robert,

Thanks for your reply. However you did not understand the problem. I read
the documentation and understood the purpose of BOOST_EXPORT as explained in
the documentation, and as reexplained in your last mail. The problem is at
linking, but is not one of undefined reference (template not instantiated),
but, on the other hand, *a multiple definition problem.*

If, as suggested, you move BOOST_EXPORT to the class header, even if you
move the archive headers before the serialization/export header, you will
have multiple instantiations of the same template. This is because every
time you include the serialization class header in your program there is
some code instantiation, since the EXPORT is in that file.

*** Hmmm - I'll look into this. I would have expected that additional code
would be generated if and only if <boost/archive/...
headers are included. If these are included only once, I wouldn't expect
any multiple definitions. The top of export.hpp
includes the following:

// if no archive headers have been included this is a no op
// this is to permit BOOST_EXPORT etc to be included in a
// file declaration header
#if ! defined(BOOST_ARCHIVE_BASIC_ARCHIVE_HPP)
#define BOOST_CLASS_EXPORT_GUID_ARCHIVE_LIST(T, K, ASEQ)

which I would expect would make a BOOST_EXPORT an effective no-op if no
archive files are included.
****

Robert Ramey


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