First, I am trying to figure out how to use BOOST_CLASS_EXPORT. I am
trying to do it using the following advice from the documentation:
"As noted in the comments, this would work. But #include
<.../export.hpp> can't be used without conflicting with other modules
which use #include <.../*archive.hpp>. In this case we can move the
export to an implementation file:
// A.cpp
#include "A.hpp"
...
// export.hpp header should be last;
#include
...
BOOST_CLASS_EXPORT(A)
..."
In fact, my implementation file contains *only* BOOST_CLASS_EXPORT
statements.
Code like this seems to compile only if I also include archive headers like:
#include
#include
If these directives are omitted, then my code does not compile.
Is this correct? (I didn't see anything about this in the documentation)
But now if a class that is being exported contains a
boost::shared_ptr<..> member (so I have to #include
boost/serialization/shared_ptr.hpp), then I get the following
compilation errors (in MSVC8.0express):
..\..\..\vendor\boost\boost/serialization/shared_ptr.hpp(134) : error
C2039: 'reset' : is not a member of 'boost::archive::naked_xml_iarchive'
..\..\..\vendor\boost\boost/archive/xml_iarchive.hpp(91) : see
declaration of 'boost::archive::naked_xml_iarchive'
..\..\..\vendor\boost\boost/serialization/split_free.hpp(58) :
see reference to function template instantiation 'void
boost::serialization::load(Archive
&,boost::shared_ptr<T> &,const unsigned int)' being compiled
Can someone tell from this what I'm doing wrong?