[serialization] serialization used in multiple DLL problems

Hi, I was able to make this work on serialization after some minor modifications: PS: pseudo-code DLL1: header.h BOOST_IS_ABSTRACT(base); class base { virtual ~base() {} // serialization }; source.cpp class derived : base { // serialization }; BOOST_CLASS_EXPORT(derived); void serialize(oarchive& ar) { boost::shared_ptr<derived> p(new derived); ar << p; } DLL2: std::stringstream stm; { oarchive oar(stm); serialize(oar); } { iarchive iar(stm); boost::shared_ptr<base> p; iar >> p; // deserializing a derived class defined in DLL1 in DLL2 } I had to compile serialization as a lib. And making tk_map and kt_map global objects (not sure if this is necessary though), removing the assertion about multiple inserts in static insert function of both [kt][tk]_map's and commenting line 315 of basic_oarchive: //if((cobject_info_set.size() > original_count)){ +{ I don't know the internals of serialization enough to say this is anything near correct. And I'll still need to test more, which I will do, since I need this functionality very much. Regards, -- Felipe Magno de Almeida

It just so happens that as I write this I'm working on a definitive solution to this issue. I believe that I will get it resolved soon - though probably not soon enough for 1.35. Of course that depends on how long 1.35 takes. Robert Ramey Felipe Magno de Almeida wrote:
Hi,
I was able to make this work on serialization after some minor modifications: PS: pseudo-code
DLL1: header.h BOOST_IS_ABSTRACT(base); class base { virtual ~base() {} // serialization }; source.cpp class derived : base { // serialization }; BOOST_CLASS_EXPORT(derived);
void serialize(oarchive& ar) { boost::shared_ptr<derived> p(new derived); ar << p; }
DLL2: std::stringstream stm;
{ oarchive oar(stm); serialize(oar); }
{ iarchive iar(stm); boost::shared_ptr<base> p; iar >> p; // deserializing a derived class defined in DLL1 in DLL2 }
I had to compile serialization as a lib. And making tk_map and kt_map global objects (not sure if this is necessary though), removing the assertion about multiple inserts in static insert function of both [kt][tk]_map's and commenting line 315 of basic_oarchive: //if((cobject_info_set.size() > original_count)){ +{
I don't know the internals of serialization enough to say this is anything near correct. And I'll still need to test more, which I will do, since I need this functionality very much.
Regards,

Hi Robert, Can I take a pick at your code? On Nov 5, 2007 2:43 AM, Robert Ramey <ramey@rrsd.com> wrote:
It just so happens that as I write this I'm working on a definitive solution to this issue. I believe that I will get it resolved soon - though probably not soon enough for 1.35. Of course that depends on how long 1.35 takes.
Robert Ramey
Felipe Magno de Almeida wrote:
Hi,
I was able to make this work on serialization after some minor modifications: PS: pseudo-code
DLL1: header.h BOOST_IS_ABSTRACT(base); class base { virtual ~base() {} // serialization }; source.cpp class derived : base { // serialization }; BOOST_CLASS_EXPORT(derived);
void serialize(oarchive& ar) { boost::shared_ptr<derived> p(new derived); ar << p; }
DLL2: std::stringstream stm;
{ oarchive oar(stm); serialize(oar); }
{ iarchive iar(stm); boost::shared_ptr<base> p; iar >> p; // deserializing a derived class defined in DLL1 in DLL2 }
I had to compile serialization as a lib. And making tk_map and kt_map global objects (not sure if this is necessary though), removing the assertion about multiple inserts in static insert function of both [kt][tk]_map's and commenting line 315 of basic_oarchive: //if((cobject_info_set.size() > original_count)){ +{
I don't know the internals of serialization enough to say this is anything near correct. And I'll still need to test more, which I will do, since I need this functionality very much.
Regards,
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
-- Felipe Magno de Almeida

Felipe Magno de Almeida wrote:
Hi Robert,
Can I take a pick at your code?
LOL I presume you mean "peek". You can find it at http://svn.boost.org/trac/boost/browser/branches/serialization_next_release I need to check in a couple of very minor tweaks. Hopefully I'll do that today. Then you should be able to download the serialization directories on that branch. I test it against 1.34 so it should be compatible with boost 1.34 and hopefully boost 1.35. It will be part of boost 1.36. Robert Ramey

On Dec 17, 2007 2:53 PM, Robert Ramey <ramey@rrsd.com> wrote:
Felipe Magno de Almeida wrote:
Hi Robert,
Can I take a pick at your code?
LOL I presume you mean "peek".
LOL, looking at the dictionary, yes, that's exactly what I mean.
You can find it at http://svn.boost.org/trac/boost/browser/branches/serialization_next_release
Should I be able to switch the serialization directories in my boost trunk?
I need to check in a couple of very minor tweaks. Hopefully I'll do that today. Then you should be able to download the serialization directories on that branch. I test it against 1.34 so it should be compatible with boost 1.34 and hopefully boost 1.35. It will be part of boost 1.36.
Thanks Robert, I lost some of my modifications to serialization library made for the purpose of this thread when updating boost. :/
Robert Ramey
Thanks Robert! -- Felipe Magno de Almeida

On Dec 17, 2007 2:53 PM, Robert Ramey <ramey@rrsd.com> wrote:
[snip]
I need to check in a couple of very minor tweaks. Hopefully I'll do that today. Then you should be able to download the serialization directories on that branch. I test it against 1.34 so it should be compatible with boost 1.34 and hopefully boost 1.35. It will be part of boost 1.36.
..\new_boost\svn_boost\libs\serialization\src\extended_type_info.cpp(22) : fatal error C1083: Cannot open include file: 'bidirectional_map.hpp': No such file or directory error: Unable to find file or target named error: 'extended_type_info_no_rtti.cpp' Have you forget to add any files to the svn?
Robert Ramey
Thanks, -- Felipe Magno de Almeida
participants (2)
-
Felipe Magno de Almeida
-
Robert Ramey