<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><DIV>Hi,</DIV> <DIV> I have a query regarding macro BOOST_CLASS_VERSION().<BR> I am running following code :</DIV> <DIV> class testRep<BR> {<BR> friend std::ostream & operator<<(std::ostream &os, const testRep &tr);<BR> <BR> public :<BR> template<class Archive> void serialize(Archive &ar, const unsigned int version)<BR> {<BR> if(version >= 2)<BR> ar & BOOST_SERIALIZATION_NVP(Site);<BR> }</DIV> <DIV> private :<BR> string Site;<BR> };<BR> <BR> BOOST_CLASS_VERSION(testRep, 2)<BR> <BR> std::ostream & operator<<(std::ostream &os, const testRep &tr)<BR> {<BR> return os << '\n' << tr.Site << endl;<BR> }<BR> <BR> void read_file (testRep &s, const char * filename)<BR> {<BR> std::ifstream ifs(filename);<BR> assert (ifs.good());<BR> boost::archive::xml_iarchive ia(ifs);</DIV> <DIV> ia >> BOOST_SERIALIZATION_NVP(s);<BR> }</DIV> <DIV> int main (void)<BR> {<BR> testRep tr;<BR> read_file (tr, "Test.xml");<BR> cout << tr << endl;</DIV> <DIV> return 0;<BR> }</DIV> <DIV> This code runs fine.<BR> But, if I remove the statement :<BR> BOOST_CLASS_VERSION(testRep, 2)<BR> <BR> then I get following error :<BR> terminate called after throwing an instance of 'boost::archive::archive_exception'<BR> what(): class version<BR> Aborted (core dumped)<BR> <BR> So, want to ask if it is mandatory to declare a macro BOOST_CLASS_VERSION()? and if not then how do I prevent this runtime error from happening?</DIV> <DIV> </DIV> <DIV>Regards,<BR>Girish</DIV></td></tr></table><br>