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