You can't serialize and incomplet type.
Try the following:
class fd; // forward declaration
class base: class derived
{
.....
fd *ptr;
.....
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int file_version);
{
(void) file_version;
ar & ptr;
ar & boost::serialization::base_object<derived>(*this);
}
}; //end of class base
In a *.cpp file
#include "fd.h"
template<class Archive>
void base::serialize(Archive & ar, const unsigned int file_version);
{
ar & ptr;
ar & boost::serialization::base_object<derived>(*this);
}
Robert Ramey
"niranjan bangera" wrote in message news:50a2f6f20901112119p631960d5ncc524bec7beef22@mail.gmail.com...
hi all,
i have done in the following way.. even am getting some errors, did i miss any of the headers, or added extra(added extra for sure).
Any suggestions will be accepted
#include
#include
#include
#include
#include <fstream>
#include
#include
#include
class fd;
class base: class derived
{
.....
fd *ptr;
.....
friend class boost::serialization::access;
template<class Archive>
void serialize(Archive & ar, const unsigned int file_version)
{
(void) file_version;
ar & ptr;
ar & boost::serialization::base_object<derived>(*this);
}
}; //end of class base
Version::1.36.0
compliler: g++ 4.1.1....
i am getting a error :
error: forward declaration of 'struct fd'
/boost_1_36_0/include/boost-1_36/boost/serialization/access.hpp:109: error: inva
lid use of undefined type 'struct
/project/wipro_virtutech_nobackup/users/niranjan/project_new/boost_1_36_0/include/boost-1_36/boost/serialization/extended_type_info_typeid.hpp:117: note: neither the destructor nor the class-specific operator delete will be called, even if they are declared when the class is defined.
Thanks in advance.....
------------------------------------------------------------------------------
_______________________________________________
Boost-users mailing list
Boost-users@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users