
Wilson Tim-CTW024 wrote:
I've run into a conflict between use of the polymorphic archives and the BOOST_CLASS_EXPORT() macro. It doesn't seem possible to use both without getting a link error. The following code illustrates the problem (yes, I know this code doesn't do anything worth doing, but it's the simplest code that demonstrates the problem):
----------------------
# include <sstream>
# include <boost/serialization/export.hpp> # include <boost/archive/polymorphic_binary_oarchive.hpp>
class A { public:
template<class Archive> void serialize(Archive & ar, const unsigned version) { }
};
///BOOST_CLASS_EXPORT(A); // need only for derived classes
int main() {
A a;
std::ostringstream os(std::ios_binary); // make sure stream is opened binary // boost::archive::polymorphic_binary_oarchive oa(os); boost::archive::polymorphic_oarchive & oa = boost::archive::polymorphic_binary_oarchive(os); oa & a; }
Try the above changes. Robert Ramey