The real question here is:
What else is supposed to be in this file? Do I need to put in the code that loads and saves archives in this file?
And here is the answer.
I expect that BOOST_CLASS_EXPORT will be specified in the same
header file as the class declaration to which it corresponds. That is,
BOOST_CLASS_EXPORT(T) is a "trait" of the class. This trait
is the "external name" used to identify the class and is needed when
serializing polymorphic types through a base class pointer.
I expect that one's program will generally look like:
#include
Robert Ramey wrote:
In fact, my implementation file contains *only* BOOST_CLASS_EXPORT statements.
Then no code will be instantiated - as you have indeed found.
Code like this seems to compile only if I also include archive headers like: #include
#include correct.
If these directives are omitted, then my code does not compile.
Hmmm - the required code to export class x to archive xml_?archive.hpp will not be instantiated. I would expect that to show up as a missing symbol during linking.
No, I get something like:
..\..\..\..\vendor\boost\boost/serialization/type_info_implementation.hpp(48)
error C2027: use of undefined type 'boost::serialization::extended_type_info_impl<T>' with [ T=Input::Bond ] ..\..\..\..\vendor\boost\boost/serialization/export.hpp(75) : see reference to class template instantiation 'boost::serialization::type_info_implementation<T>' being compiled with [ T=Input::Bond ]
OK - I believe that is misleading. I'm changing my local copy to
#include