#include #include #include using namespace std; #include "base.h" B* get_b(); //BOOST_CLASS_EXPORT(D); int main() { ofstream ofs("xxx"); boost::archive::text_oarchive oa(ofs); B* b = new D; oa << get_b(); ofs.close(); return 0; }