Boost.Serialization not building

I attempted the build Boost.Serialization from trunk and got some errors: binary_iarchive.cpp .\boost/serialization/void_cast.hpp(255) : error C2572: 'boost::serialization::void_cast_register' : redefinition of default parameter : parameter 2 .\boost/serialization/void_cast_fwd.hpp(30) : see declaration of 'boost::serialization::void_cast_register' .\boost/serialization/void_cast.hpp(255) : error C2572: 'boost::serialization::void_cast_register' : redefinition of default parameter : parameter 1 .\boost/serialization/void_cast_fwd.hpp(30) : see declaration of 'boost::serialization::void_cast_register'

On Wed, Oct 14, 2009 at 12:54 AM, OvermindDL1
I attempted the build Boost.Serialization from trunk and got some errors:
binary_iarchive.cpp .\boost/serialization/void_cast.hpp(255) : error C2572: 'boost::serialization::void_cast_register' : redefinition of default parameter : parameter 2 .\boost/serialization/void_cast_fwd.hpp(30) : see declaration of 'boost::serialization::void_cast_register' .\boost/serialization/void_cast.hpp(255) : error C2572: 'boost::serialization::void_cast_register' : redefinition of default parameter : parameter 1 .\boost/serialization/void_cast_fwd.hpp(30) : see declaration of 'boost::serialization::void_cast_register'
In void_cast_fwd.hpp, on lines 30 - 33, I changed it from this: inline const void_cast_detail::void_caster & void_cast_register( const Derived * dnull = NULL, const Base * bnull = NULL ) BOOST_USED; To this: inline const void_cast_detail::void_caster & void_cast_register( const Derived * dnull, const Base * bnull ) BOOST_USED; And bjam no longer complains with compile errors.

On Wed, Oct 14, 2009 at 1:04 AM, OvermindDL1
/* snip */
I also appear to have another error while trying to serialize a shared_ptr:
1>R:\SDKs\boost\built_head\include\boost-1_40\boost/archive/shared_ptr_helper.hpp(114)
: error C2440: 'return' : cannot convert from 'const
boost::serialization::extended_type_info_typeid<T>' to 'const
boost::serialization::extended_type_info *'
1> with
1> [
1> T=User
1> ]
1> No user-defined-conversion operator available that can
perform this conversion, or the operator cannot be called
1> R:\SDKs\boost\built_head\include\boost-1_40\boost/archive/shared_ptr_helper.hpp(110)
: while compiling class template member function 'const
boost::serialization::extended_type_info
*boost::archive::detail::shared_ptr_helper::non_polymorphic<T>::get_object_identifier(T
&)'
1> with
1> [
1> T=User
1> ]
1> R:\SDKs\boost\built_head\include\boost-1_40\boost/archive/shared_ptr_helper.hpp(147)
: see reference to class template instantiation
'boost::archive::detail::shared_ptr_helper::non_polymorphic<T>' being
compiled
1> with
1> [
1> T=User
1> ]
1> R:\SDKs\boost\built_head\include\boost-1_40\boost/serialization/shared_ptr.hpp(142)
: see reference to function template instantiation 'void
boost::archive::detail::shared_ptr_helper::reset<User>(boost::shared_ptr<T>
&,T *)' being compiled
1> with
1> [
1> T=User
1> ]
1> R:\SDKs\boost\built_head\include\boost-1_40\boost/serialization/split_free.hpp(58)
: see reference to function template instantiation 'void
boost::serialization::load

On Wed, Oct 14, 2009 at 6:13 AM, OvermindDL1
/* snip */
And another thing, why does the binary and text archives work fine with some very simple code (some strings in shared_ptr's), but xml archives gives this entire error: 1>R:\SDKs\boost\built_head\include\boost-1_40\boost/archive/basic_xml_oarchive.hpp(87) : error C2664: 'boost::mpl::assertion_failed' : cannot convert parameter 1 from 'boost::mpl::failed ************boost::serialization::is_wrapper<T>::* ***********' to 'boost::mpl::assert<false>::type' 1> with 1> [ 1> T=UserManagerServer 1> ] 1> No constructor could take the source type, or constructor overload resolution was ambiguous 1> R:\SDKs\boost\built_head\include\boost-1_40\boost/archive/detail/interface_oarchive.hpp(64) : see reference to function template instantiation 'void boost::archive::basic_xml_oarchive<Archive>::save_override<T>(T &,int)' being compiled 1> with 1> [ 1> Archive=boost::archive::xml_oarchive, 1> T=UserManagerServer 1> ] 1> r:\programming_projects\web_projects\something\Serializer_Data_Storage_Sync.hpp(40) : see reference to function template instantiation 'Archive &boost::archive::detail::interface_oarchive<Archive>::operator <<<UserManagerServer>(T &)' being compiled 1> with 1> [ 1> Archive=boost::archive::xml_oarchive, 1> T=UserManagerServer 1> ] So what do I need to do to the xml archive to get it to work like the others?

OvermindDL1 wrote:
On Wed, Oct 14, 2009 at 1:04 AM, OvermindDL1
wrote: /* snip */
I also appear to have another error while trying to serialize a shared_ptr: I have spent about the last 4 hours changing one thing and changing another and nothing I do seems to ever work. And yes it happens with different archive types and so forth. I think I narrowed down the issue to line 42 in file boost\serialization\type_info_implementation.hpp but I am not certain, if it is not this line directly it is something that builds it up... Yes I do include the shared_ptr helper as the examples show (serialization\example\demo_shared_ptr.cpp), and tried various macros for registering it and so forth...
Does test_share_ptr included with the package compile and run with your system? If not, I would like to hear about it. If so, check how your application differs from the test.
So any ideas why a non-virtual class/struct causes Boost.Serialization to choke in a shared_ptr (but works fine as a normal pointer), but a virtual one works?
This might be due to trying to serialize a non-polymorphic class through a base class pointer. Of course without seeing the source code, there's no way for anyone to know.
Also, I noticed that the tr1 containers are not supported, such an unordered_set. I created my own serializer for those, but it seems odd that it is not included since it seems to contains everything else from the stl, and the tr1 containers have been in Boost for quite some time now.
No One has done it yet. Feel free to upload you version to the vault. Robert Ramey

On Wed, Oct 14, 2009 at 11:51 AM, Robert Ramey
OvermindDL1 wrote:
On Wed, Oct 14, 2009 at 1:04 AM, OvermindDL1
wrote: /* snip */
I also appear to have another error while trying to serialize a shared_ptr: I have spent about the last 4 hours changing one thing and changing another and nothing I do seems to ever work. And yes it happens with different archive types and so forth. I think I narrowed down the issue to line 42 in file boost\serialization\type_info_implementation.hpp but I am not certain, if it is not this line directly it is something that builds it up... Yes I do include the shared_ptr helper as the examples show (serialization\example\demo_shared_ptr.cpp), and tried various macros for registering it and so forth...
Does test_share_ptr included with the package compile and run with your system? If not, I would like to hear about it. If so, check how your application differs from the test.
If I get some time soon I will.
On Wed, Oct 14, 2009 at 11:51 AM, Robert Ramey
So any ideas why a non-virtual class/struct causes Boost.Serialization to choke in a shared_ptr (but works fine as a normal pointer), but a virtual one works?
This might be due to trying to serialize a non-polymorphic class through a base class pointer. Of course without seeing the source code, there's no way for anyone to know.
This is basically the class: class User { public: User(std::string name, std::string pass) :name_(name) ,pass_(pass) {} private: std::string name_; std::string pass_; } And it could not be serialized through a smart pointer
Also, I noticed that the tr1 containers are not supported, such an unordered_set. I created my own serializer for those, but it seems odd that it is not included since it seems to contains everything else from the stl, and the tr1 containers have been in Boost for quite some time now.
No One has done it yet. Feel free to upload you version to the vault.
I can try to finish wrapping the rest (seemed pretty easy, Boost.Serialization already has things to handle basically all stl-style container types, it just was not yet exposed to the new tr1 version, but seems to work perfectly with them) and do that after testing that they work, but it may take some time, I get free time about once a week (last night for this week).

On Wed, Oct 14, 2009 at 5:28 PM, OvermindDL1
/* snip */
I cannot really work on it right now, but the overhead of making these structs virtual when they do not need to be (just so Boost.Serialize does not die), is definitely making a noticeable increase in memory (doubling the size of these structs, and I am making a lot of them). It is a long running process and I do need to minimize memory use during run-time, so how can I work-around this Boost.Serializer bug?
participants (2)
-
OvermindDL1
-
Robert Ramey