Boost logo

Boost Users :

From: Robert Ramey (ramey_at_[hidden])
Date: 2005-05-30 09:39:36

MessageActually, the export.hpp has to come after any *archive.hpp due to the "trick" used to instantiate the appropriate code.

On some compilers, one can get multiple symbol errors. I think the only way to handle this is to be sure its included at most once or tweak the linker switches to override the error.

Robert Ramey
  "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