Boost logo

Boost Users :

From: Jeff Flinn (TriumphSprint2000_at_[hidden])
Date: 2005-05-30 09:36:31


Your original post was missing

   friend class boost::serialization::access;

from the class declarations. Is that the case in your actual code?

I'm not sure is Robert meant to say that BOOST_CLASS_EXPORT should go in the header. I place these calls in a cpp file with the appropriate archive header inclusions.

Jeff Flinn


In the future, can you limit postings to text only? It makes it difficult to avoid top posting. Also reply to specific postings in order to preserve message threading, since many of us use the news reader to view and respond to messages.

  "Eric" <eric-public_at_[hidden]> wrote in message news:001601c564d9$35709a60$0a00a8c0_at_FASTBRICK...
  Thanks Robert. This partially worked... Your comment about putting the BOOST_CLASS_EXPORT macro into the header keyed me into something.

  I am using the BOOST_CLASS_EXPORT(derived) macro, but I've been placing them into the source (cpp) file instead of the header (h) file. With my system, when I put BOOST_CLASS_EXPORT(derived) into the header file, I get a multiply-defined error at link time (the offending code is boost::archive::detail::guid_initializer<class,...> since the header is included multiple times when I use the class.

  As a test, I setup a sandbox with a stripped down system and was able to get it to work when I put the BOOST_CLASS_EXPORT in the header, but not when it is in the cpp file.

  Q: Why does the location of the BOOST_CLASS_EXPORT matter? Is it doing order-depended initialization upon bringing up the system?
  Q: How do I avoid the mutiple defined error in the linker?

  Thanks again for your help and the library :)



  Boost-users mailing list

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at