
I'm trying to send polymorphic objects using boost::mpi, but I'm getting extensive "undefined reference" errors for the simple test case below. If I #include <boost/archive/text_oarchive.hpp> instead of the mpi/communicator, everything compiles fine. Any help greatly appreciated, Simon #include <boost/mpi/communicator.hpp> #include <boost/serialization/export.hpp> struct Base { virtual ~Base() {} virtual int id() const { return 1; } template<class Archive> void serialize(Archive &ar, const unsigned int) { ar & data; } int data; }; struct Derived : public Base { virtual int id() const { return 2; } }; BOOST_CLASS_EXPORT(Base) BOOST_CLASS_EXPORT(Derived) int main(int argc, char *argv[]) { Base *b = new Base; Base *d = new Derived; delete b; delete d; return 0; }