
Marc Wäckerlin wrote:
Brian Stempel wrote:
Now I started by reading the "Serialization Archive Class Reference" on http://boost.org/libs/serialization/doc/archive_reference.html, which describes how to implement my own archive.
Unfortunately, if I copy the code from the "simplest possible output archive" there into a header file, then write a code file that does nothing except including that header, the result is not compilable (GNU g++ 4.1.2).
First problem:
friend class boost::archive::load_access is undefined, so I have to add a forward declaration: namespace boost { namespace archive { class load_access; } }
Hmm - I looked at this again and didn't see the need for the above. In fact, when I compiled with my other compilers - none complained. So, though its harmless to add - I'm not sure it should be in the example.
Second problem (see attached test.cpp):
In compiling your/my example from the document with VC 7.1 - though not with the other compilers at hand, I did get an error - which was a surprise to me. However, its a different error than the one you get. Also none of my other compilers had a problem with this. So my real answer to your question "What's missing?" is "I don't know". Both your error message from gcc 4.1 and mine from VC 7.1 - which are different - can't be explained by me. So I would say we'll have to call this "under investigation" Adding more "#includes" might seem to fix the problem. But the point of the example is to show what a minimal example is - so I'm really curious as to what is going on. You might try replacing your versions of the attached files with the attached one and let me know what happens. Robert Ramey
g++ test.cpp /usr/include/boost/archive/detail/interface_iarchive.hpp: In member function 'const boost::archive::detail::basic_pointer_iserializer* boost::archive::detail::interface_iarchive<Archive>::register_type(T*)': /usr/include/boost/archive/detail/interface_iarchive.hpp:54: error: 'instantiate_pointer_iserializer' is not a member of 'boost::archive::detail' /usr/include/boost/archive/detail/interface_iarchive.hpp:58: error: invalid use of undefined type 'const struct boost::archive::detail::basic_pointer_iserializer' /usr/include/boost/archive/detail/basic_iarchive.hpp:41: error: forward declaration of 'const struct boost::archive::detail::basic_pointer_iserializer'
What's missing?
Thank you Regards Marc
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
begin 666 interface_iarchive.hpp
M(VEF;F1E9B!"3T]35%]!4D-(259%7T1%5$%)3%])3E1%4D9!0T5?24%20TA)
M5D5?2%!0#0HC9&5F:6YE($)/3U-47T%20TA)5D5?1$5404E,7TE.5$521D%#
M15])05)#2$E615](4% -"@T*+R\@35,@8V]M<&%T:6)L92!C;VUP:6QE