Boost logo

Boost Users :

Subject: [Boost-users] Boost Serialization Difference in Archive Versions
From: Lynn Gilbert (lynn_at_[hidden])
Date: 2014-03-06 10:47:46


Hope everyone is doing well.

I'm having an issue with boost serialization. I have serialized a file
on my ODroid U2 using Boost v1.53. I'm trying to deserialize the file on
a computer which only has Boost v1.46; however, line 7 below causes the
following error:

CMyClass Exception thrown: unsupported version

Code:

1 void CMyClass::enableDeserialize(std::string file, bool binary) {
2 filename = file ;
3 isBinary = binary ;
4 ifs = new std::ifstream(file.c_str()) ;
5 try {
6 if (isBinary) {
7 CMyClass::ib = new boost::archive::binary_iarchive(*ifs) ;
8 } else {
9 CMyClass::ia = new boost::archive::text_iarchive(*ifs) ;
10 }
11 } catch (boost::archive::archive_exception e) {
12 std::cout << "CMyClass Exception thrown: " << e.what() <<
std::endl ;
13 }
14 }

The boost archive version for v1.53 (version I serialized with) is 10
and the boost archive version for v1.46 (the version I'm trying to
deserialize with) is 9. Boost documentation hasn't helped me determine
the differences between the 2 archive versions. I've only been able to
find answers for how to deserialize an older archive. Please note, I
don't do anything with BOOST_CLASS_VERSION. CMyClass hasn't changed at all.

I can't imagine boost can handle the deserialization of a newer archive
so I don't feel like I'm missing that answer. What I need to know if if
there is a way I can serialize in v1.53 based on boost archive version 9
instead of 10. I'm hoping the new version of boost will still allow me
to serialize at an older version. Then, I should be able to deserialize
the archive just fine.

Any advice you could provide is much appreciated!

-- 
Lynn Coddington Gilbert
Partner, Robotic Paradigm Systems
www.roboticparadigmsystems.com
www.facebook.com/RoboticParadigmSystems
lynn_at_[hidden]
678-428-0935

Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net