I am using boost::serialization in my project. The project is large, and serializes my objects in several places. According to the documentation here, I should exp
Before calling BOOST_CLASS_EXPORT_* you should include the archives which you want to use. The makro then adds specific serialize-functions for the headers.
This means you should change your code in hier.cpp to the following:
#include <boost/serialization/export.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
#include "hier.h"
BOOST_CLASS_EXPORT_IMPLEMENT(D1);
BOOST_CLASS_EXPORT_IMPLEMENT(D2);
The code in hier.h changes accordingly:
#include <boost/serialization/export.hpp>
#include <boost/archive/text_iarchive.hpp>
#include <boost/archive/text_oarchive.hpp>
BOOST_CLASS_EXPORT_KEY(B);
BOOST_CLASS_EXPORT_KEY(D1);
BOOST_CLASS_EXPORT_KEY(D2);
Sources:
Boost Serializsation Documentation
PS:
I do not know if this is solving your problem, but I think it could be causing some trouble. I think its worth a try.