Fwd: Re: [Boost-users] Re: Boost serialization and dependency nightmares...
In addition I resurrected this post to the newsgroup. It is exactly the same problem I am having: boost 1.32, with VC7.1 I'm getting compiler errors in two unrelated translation units both dealing with std::set<std::string> data members. I've gone through and ensured that i've #include'd the <set.hpp> and <string.hpp> headers from boost/serialization. Any ideas on what might be causing this problem? This has worked fine previously with boost 1.31 and serialization20 version of the library. Why would the 3 argument overload not be found? Below are the (beginnings of the ) related compiler errors. Thanks, Jeff ======================== C:\boost\boost_1_32_0\boost\serialization\split_free.hpp(55) : error C2780: 'void boost::archive::load(Archive &,T &)' : expects 2 arguments - 3 provided C:\boost\boost_1_32_0\boost\archive\detail\iserializer.hpp(514) : see declaration of 'boost::archive::load' C:\boost\boost_1_32_0\boost\serialization\split_free.hpp(54) : while compiling class-template member function 'void boost::serialization::free_loader<Archive,T>::invoke(Archive &,T &,const unsigned int)' with [ Archive=boost::archive::text_iarchive, T=std::set<std::string> ] .... ======================== C:\boost\boost_1_32_0\boost\serialization\split_free.hpp(55) : error C2780: 'void boost::archive::load(Archive &,T &)' : expects 2 arguments - 3 provided C:\boost\boost_1_32_0\boost\archive\detail\iserializer.hpp(514) : see declaration of 'boost::archive::load' C:\boost\boost_1_32_0\boost\serialization\split_free.hpp(54) : while compiling class-template member function 'void boost::serialization::free_loader<Archive,T>::invoke(Archive &,T &,const unsigned int)' with [ Archive=boost::archive::binary_iarchive, T=std::set<std::string> ] .... --- kauai <kauai_diver@yahoo.com> wrote:
Date: Mon, 9 May 2005 14:07:43 -0700 (PDT) From: kauai <kauai_diver@yahoo.com> Subject: Re: [Boost-users] Re: Boost serialization and dependency nightmares... To: boost-users@lists.boost.org
Robert,
Thank you. My project requires both linux and Win32 support. When I use this macro in win32 environment I get a compile time error. It generates a fairly long error which I can send you but here is the first few lines which are possibly the most important.
Again it is fully compiling/linking/running in Linux.
cl /nologo /W3 /MDd /Od /EHsc /RTC1 /GS /Gy /Zc:forScope /GR /Gd /TP /D_DEBUG /D WIN32 /D_CONSOLE /D_WINDOWS /DUNICODE /DQT_DLL /DQT_THREAD_SUPPORT /IW:\vob\abvsw\boost\1_32_0\win32\include\boost-1_32 /Iroot\abcmn\ /c build-win32-debug\...\xyz.cpp /Fobui ld-win32-debug\...\xyz.obj xyz.cpp W:\vob\abvsw\boost\1_32_0\win32\include\boost-1_32\boost\ serialization\split_free.hpp(55) : error C2780: 'void boost::archive::load(Archi ve &,T &)' : expects 2 arguments - 3 provided W:\vob\abvsw\boost\1_32_0\win32\include\boost-1_3 2\boost\archive\detail\iserializer.hpp(514) : see declaration of 'boost::archive ::load' W:\vob\abvsw\boost\1_32_0\win32\include\boost-1_3 2\boost\serialization\split_free.hpp(54) : while compiling class-template member function 'void
boost::serialization::free_loader<Archive,T>::invoke(Archive
&,T &,const unsigned int)'
When I #ifdef the BOOST_CLASS_EXPORT(ClassName) macros I compile/link/and run. Of course base class serialzation is disable for Win32 at the moment because of this.
Thanks for any help, -K
This is addressed with the alternative BOOST_CLASS_EXPORT method. its described in the serialization documentation.
Robert Ramey
Hi all,
I have a container class that has a vector which contains several other classes. My container class has a serialize function that looks like this:
friend class boost::serialization::access; template<class Archive> void serialize (Archive &ar, const unsigned int version) { // save/load base class information ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(MyBaseClass); ar.register_type(static_cast<SomeClass1*>(NULL)); ar.register_type(static_cast<SomeClass2*>(NULL)); ... ar & BOOST_SERIALIZATION_NVP(m_Vector); // std::vector }
Got everything working but now an issue has come up: Someone wants to add a new class but it is not part of
kauai wrote: this
package that is doing the serialzation. I want to avoid what I call "dependency hell", is there a way for
--- Robert Ramey <ramey@rrsd.com> wrote: that
new
class to get registered someplace other than in this function?
Thanks for any help, Kauai
Discover Yahoo! Stay in touch with email, IM, photo sharing and more. Check it out! http://discover.yahoo.com/stayintouch.html
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
__________________________________ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail
Discover Yahoo! Have fun online with music videos, cool games, IM and more. Check it out! http://discover.yahoo.com/online.html
Just a guess, but are the EXPORT macros being used in side a namespace? They should be outside of any namespace. Robert Ramey kauai wrote:
In addition I resurrected this post to the newsgroup. It is exactly the same problem I am having:
boost 1.32, with VC7.1 I'm getting compiler errors in two unrelated translation units both dealing with std::set<std::string> data members. I've gone through and ensured that i've #include'd the <set.hpp> and <string.hpp> headers from boost/serialization. Any ideas on what might be causing this problem? This has worked fine previously with boost 1.31 and serialization20 version of the library. Why would the 3 argument overload not be found?
Below are the (beginnings of the ) related compiler errors.
Thanks, Jeff
========================
C:\boost\boost_1_32_0\boost\serialization\split_free.hpp(55)
error C2780: 'void boost::archive::load(Archive &,T &)' : expects 2 arguments - 3 provided
C:\boost\boost_1_32_0\boost\archive\detail\iserializer.hpp(514)
see declaration of 'boost::archive::load'
C:\boost\boost_1_32_0\boost\serialization\split_free.hpp(54)
while compiling class-template member function 'void boost::serialization::free_loader<Archive,T>::invoke(Archive &,T &,const unsigned int)' with [ Archive=boost::archive::text_iarchive, T=std::set<std::string> ] ....
========================
C:\boost\boost_1_32_0\boost\serialization\split_free.hpp(55)
error C2780: 'void boost::archive::load(Archive &,T &)' : expects 2 arguments - 3 provided
C:\boost\boost_1_32_0\boost\archive\detail\iserializer.hpp(514)
see declaration of 'boost::archive::load'
C:\boost\boost_1_32_0\boost\serialization\split_free.hpp(54)
while compiling class-template member function 'void boost::serialization::free_loader<Archive,T>::invoke(Archive &,T &,const unsigned int)' with [ Archive=boost::archive::binary_iarchive, T=std::set<std::string> ]
....
--- kauai <kauai_diver@yahoo.com> wrote:
Date: Mon, 9 May 2005 14:07:43 -0700 (PDT) From: kauai <kauai_diver@yahoo.com> Subject: Re: [Boost-users] Re: Boost serialization and dependency nightmares... To: boost-users@lists.boost.org
Robert,
Thank you. My project requires both linux and Win32 support. When I use this macro in win32 environment I get a compile time error. It generates a fairly long error which I can send you but here is the first few lines which are possibly the most important.
Again it is fully compiling/linking/running in Linux.
cl /nologo /W3 /MDd /Od /EHsc /RTC1 /GS /Gy /Zc:forScope /GR /Gd /TP /D_DEBUG /D WIN32 /D_CONSOLE /D_WINDOWS /DUNICODE /DQT_DLL /DQT_THREAD_SUPPORT /IW:\vob\abvsw\boost\1_32_0\win32\include\boost-1_32 /Iroot\abcmn\ /c build-win32-debug\...\xyz.cpp /Fobui ld-win32-debug\...\xyz.obj xyz.cpp W:\vob\abvsw\boost\1_32_0\win32\include\boost-1_32\boost\ serialization\split_free.hpp(55) : error C2780: 'void boost::archive::load(Archi ve &,T &)' : expects 2 arguments - 3 provided W:\vob\abvsw\boost\1_32_0\win32\include\boost-1_3 2\boost\archive\detail\iserializer.hpp(514) : see declaration of 'boost::archive
load' W:\vob\abvsw\boost\1_32_0\win32\include\boost-1_3 2\boost\serialization\split_free.hpp(54) : while compiling class-template member function 'void
boost::serialization::free_loader<Archive,T>::invoke(Archive
&,T &,const unsigned int)'
When I #ifdef the BOOST_CLASS_EXPORT(ClassName) macros I compile/link/and run. Of course base class serialzation is disable for Win32 at the moment because of this.
Thanks for any help, -K
--- Robert Ramey <ramey@rrsd.com> wrote:
This is addressed with the alternative BOOST_CLASS_EXPORT method. its described in the serialization documentation.
Robert Ramey
kauai wrote:
Hi all,
I have a container class that has a vector which contains several other classes. My container class has a serialize function that looks like this:
friend class boost::serialization::access; template<class Archive> void serialize (Archive &ar, const unsigned int version) { // save/load base class information ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(MyBaseClass); ar.register_type(static_cast<SomeClass1*>(NULL)); ar.register_type(static_cast<SomeClass2*>(NULL)); ... ar & BOOST_SERIALIZATION_NVP(m_Vector); // std::vector }
Got everything working but now an issue has come up: Someone wants to add a new class but it is not part of this package that is doing the serialzation. I want to avoid what I call "dependency hell", is there a way for that new class to get registered someplace other than in this function?
Thanks for any help, Kauai
Discover Yahoo! Stay in touch with email, IM, photo sharing and more. Check it out! http://discover.yahoo.com/stayintouch.html
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
__________________________________ Do you Yahoo!? Yahoo! Mail - You care about security. So do we. http://promotions.yahoo.com/new_mail
Discover Yahoo! Have fun online with music videos, cool games, IM and more. Check it out! http://discover.yahoo.com/online.html
Hi Robert, The EXPORT macros were initially inside a namespace, interesting that it compiled and linked with gcc. After fixing this I still have the same problem with Microsofts compiler. It complains about the same thing as I state below. Is there some include file that I may be missing? I can send you some code if that helps. Also where is the best place to call these macros? At the moment they are at the top in the appropriate .cpp files. Thanks, -K --- Robert Ramey <ramey@rrsd.com> wrote:
Just a guess, but are the EXPORT macros being used in side a namespace? They should be outside of any namespace.
Robert Ramey
In addition I resurrected this post to the newsgroup. It is exactly the same problem I am having:
boost 1.32, with VC7.1 I'm getting compiler errors in two unrelated translation units both dealing with std::set<std::string> data members. I've gone through and ensured that i've #include'd the <set.hpp> and <string.hpp> headers from boost/serialization. Any ideas on what might be causing this problem? This has worked fine
with boost 1.31 and serialization20 version of the
kauai wrote: previously library.
Why would the 3 argument overload not be found?
Below are the (beginnings of the ) related compiler errors.
Thanks, Jeff
========================
C:\boost\boost_1_32_0\boost\serialization\split_free.hpp(55)
error C2780: 'void boost::archive::load(Archive &,T &)' : expects 2 arguments - 3 provided
C:\boost\boost_1_32_0\boost\archive\detail\iserializer.hpp(514)
see declaration of 'boost::archive::load'
C:\boost\boost_1_32_0\boost\serialization\split_free.hpp(54)
while compiling class-template member function 'void
boost::serialization::free_loader<Archive,T>::invoke(Archive
&,T &,const unsigned int)' with [ Archive=boost::archive::text_iarchive, T=std::set<std::string> ] ....
========================
C:\boost\boost_1_32_0\boost\serialization\split_free.hpp(55)
error C2780: 'void boost::archive::load(Archive &,T &)' : expects 2 arguments - 3 provided
C:\boost\boost_1_32_0\boost\archive\detail\iserializer.hpp(514)
see declaration of 'boost::archive::load'
C:\boost\boost_1_32_0\boost\serialization\split_free.hpp(54)
while compiling class-template member function 'void
boost::serialization::free_loader<Archive,T>::invoke(Archive
&,T &,const unsigned int)' with [ Archive=boost::archive::binary_iarchive, T=std::set<std::string> ]
....
--- kauai <kauai_diver@yahoo.com> wrote:
Date: Mon, 9 May 2005 14:07:43 -0700 (PDT) From: kauai <kauai_diver@yahoo.com> Subject: Re: [Boost-users] Re: Boost serialization and dependency nightmares... To: boost-users@lists.boost.org
Robert,
Thank you. My project requires both linux and Win32 support. When I use this macro in win32 environment I get a compile time error. It generates a fairly long error which I can send you but here is the first few lines which are possibly the most important.
Again it is fully compiling/linking/running in Linux.
cl /nologo /W3 /MDd /Od /EHsc /RTC1 /GS /Gy /Zc:forScope /GR /Gd /TP /D_DEBUG /D WIN32 /D_CONSOLE /D_WINDOWS /DUNICODE /DQT_DLL /DQT_THREAD_SUPPORT /IW:\vob\abvsw\boost\1_32_0\win32\include\boost-1_32 /Iroot\abcmn\ /c build-win32-debug\...\xyz.cpp /Fobui ld-win32-debug\...\xyz.obj xyz.cpp
W:\vob\abvsw\boost\1_32_0\win32\include\boost-1_32\boost\
serialization\split_free.hpp(55) : error C2780: 'void boost::archive::load(Archi ve &,T &)' : expects 2 arguments - 3 provided
W:\vob\abvsw\boost\1_32_0\win32\include\boost-1_3
2\boost\archive\detail\iserializer.hpp(514) : see declaration of 'boost::archive
load'
W:\vob\abvsw\boost\1_32_0\win32\include\boost-1_3
2\boost\serialization\split_free.hpp(54) : while compiling class-template member function 'void
boost::serialization::free_loader<Archive,T>::invoke(Archive
&,T &,const unsigned int)'
When I #ifdef the BOOST_CLASS_EXPORT(ClassName) macros I compile/link/and run. Of course base class serialzation is disable for Win32 at the moment because of this.
Thanks for any help, -K
This is addressed with the alternative BOOST_CLASS_EXPORT method. its described in the serialization documentation.
Robert Ramey
kauai wrote:
Hi all,
I have a container class that has a vector which contains several other classes. My container class has a serialize function that looks like this:
friend class boost::serialization::access; template<class Archive> void serialize (Archive &ar, const unsigned int version) { // save/load base class information ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(MyBaseClass); ar.register_type(static_cast<SomeClass1*>(NULL)); ar.register_type(static_cast<SomeClass2*>(NULL)); ... ar & BOOST_SERIALIZATION_NVP(m_Vector); // std::vector }
Got everything working but now an issue has come up: Someone wants to add a new class but it is not part of this package that is doing the serialzation. I want to avoid what I call "dependency hell", is there a way for
--- Robert Ramey <ramey@rrsd.com> wrote: that new
class to get registered someplace other than in this function?
Thanks for any help, Kauai
Discover Yahoo! Stay in touch with email, IM, photo sharing and more. Check it out! http://discover.yahoo.com/stayintouch.html
_______________________________________________
=== message truncated === __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
"kauai" <kauai_diver@yahoo.com> wrote in message news:20050510182406.59092.qmail@web60712.mail.yahoo.com...
Hi Robert,
The EXPORT macros were initially inside a namespace, interesting that it compiled and linked with gcc.
After fixing this I still have the same problem with Microsofts compiler. It complains about the same thing as I state below. Is there some include file that I may be missing? I can send you some code if that helps.
I use: #define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP previous to including any boost serialization headers. I'm not sure it'll solve your issues, but it did with mine with VC7.1. Jeff Flinn
For what its worth, changes have been made for 1.33 which work better with argument dependent lookup as well as two-phase lookup. I envisioned that the EXPORT marcros be in the class header after the class declaration. For export to work properly, the archive includes have to before the class heades with EXPORT in them All serialization traites macros like EXPORT must be invoke from the global namespace. Robert Ramey Jeff Flinn wrote:
"kauai" <kauai_diver@yahoo.com> wrote in message news:20050510182406.59092.qmail@web60712.mail.yahoo.com...
Hi Robert,
The EXPORT macros were initially inside a namespace, interesting that it compiled and linked with gcc.
After fixing this I still have the same problem with Microsofts compiler. It complains about the same thing as I state below. Is there some include file that I may be missing? I can send you some code if that helps.
I use:
#define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
previous to including any boost serialization headers. I'm not sure it'll solve your issues, but it did with mine with VC7.1.
Jeff Flinn
participants (3)
-
Jeff Flinn
-
kauai
-
Robert Ramey