Boost logo

Boost Users :

Subject: Re: [Boost-users] [Serialization] Linker errors issue with using binary_wiarchive.hpp and binary_woarchive.hpp
From: Robert Ramey (ramey_at_[hidden])
Date: 2012-05-04 13:57:01


Lord Metritutus Merkwurdichliebe wrote:
> Hello there, I've never used one of these Mailing List conversations
> before so I apologise for any mistakes.
>
>
> To the point: I'm having issues trying to get the wide character
> version of Boost's serialization libaries working. When I attempt to
> compile the result is a multitude of Linker errors. After Googling
> failed to turn up anything I posted the question on Stack Overflow,
> where a reply suggested there may be 'a bug in Boost.Serialization'.
> Stack Overflow features nice syntax highlighting so it is easy to see
> the code, I pieced it together from other normal character examples:
> http://stackoverflow.com/questions/10439984/serialization-example-of-boost-archive-binary-woarchive-hpp-and-or-boost-archive
>
>
> If there is a rule against posting external links, I apologise. Or
> if people want me to paste the code directly in to an email for this
> mailing list I will do so. The Stack Overflow question was
> originally based on my thought that I had made a mistake in my code.
> If this IS the case then I do apologise, and I would appreciate
> knowing just where I've gone wrong.
>
>
> Regards.

Here is the problem:
    #include <boost/archive/binary_woarchive.hpp>
    #include <boost/archive/binary_wiarchive.hpp>

These headers exist in the package. They were added in to satisfy
my natural predudice for symetry and completeness. However,
I've never been able to see why anyone would have a reason to use
them. The build doesn't build the corresponding library components
and they aren't tested. Think of them as either your appendix or maybe
the Higgs Boson of the serialization library.

Just use

    #include <boost/archive/binary_oarchive.hpp>
    #include <boost/archive/binary_iarchive.hpp>

These should serve your purpose. Note that all the archive classes
can save/restore wide char data types. This respects the principle
that all archives handle any data type.

Robert Ramey


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