More on Serialization Link Issue

I've continue to play around with this for a few days. The problem revolves around std::wstring. I can serialize just about anything, with the exception of a std::wstring, using the library. Am I required to use the wide version of the archives to do std::wstring? If so, is there some mechanism by which a compiler error can be triggered if you try to use a std::wstring with a non wide version of an archive? As a side note, I've tried to incorporate the wide version of the library and use that, but I'm running into a different batch of link errors: error LNK2019: unresolved external symbol "public: __thiscall boost::archive::xml_wiarchive_impl<class boost::archive::xml_wiarchive>::xml_wiarchive_impl<class boost::archive::xml_wiarchive>(class std::basic_istream<unsigned short,struct std::char_traits<unsigned short> > &,unsigned int)" error LNK2019: unresolved external symbol "public: __thiscall boost::archive::xml_woarchive_impl<class boost::archive::xml_woarchive>::xml_woarchive_impl<class boost::archive::xml_woarchive>(class std::basic_ostream<unsigned short,struct std::char_traits<unsigned short> > &,unsigned int)" error LNK2019: unresolved external symbol "public: __thiscall boost::archive::basic_text_oprimitive<class std::basic_ostream<unsigned short,struct std::char_traits<unsigned short> > >::~basic_text_oprimitive<class std::basic_ostream<unsigned short,struct std::char_traits<unsigned short> > >(void)" (??1?$basic_text_oprimitive@V?$basic_ostream@GU?$char_traits@G@std@@@std@@@archive@boost@@QAE@XZ) referenced in function "public: virtual __thiscall boost::archive::xml_woarchive_impl<class boost::archive::xml_woarchive>::~xml_woarchive_impl<class boost::archive::xml_woarchive>(void)" Any thoughts? I actually still get the same errors caused by the use of std::wstring as well. Jared

Jared McIntyre wrote:
I've continue to play around with this for a few days. The problem revolves around std::wstring. I can serialize just about anything, with the exception of a std::wstring, using the library. Am I required to use the wide version of the archives to do std::wstring? If so, is there some mechanism by which a compiler error can be triggered if you try to use a std::wstring with a non wide version of an archive?
No, note that the test_simple_class includes serialization of a wstring object and that it seems to work with all archive types Are you including: include <boost/serialization/string.hpp> in your code?
As a side note, I've tried to incorporate the wide version of the library and use that, but I'm running into a different batch of link errors:
Note that there are TWO serialization libraries. libboost_serialization includes all basic code for serialization as well as precompiled class for character mode i/o. libboost_wserialization includes precompiled classes for wide character i/o. This was done this way in order to a) simplify thngs for platforms which don't implement wide character i/o b) speed up things for those who don't use wide character i/o So in addition to linking with libboost_serialization.lib, link with libboost_wserialization.lib as well Robert Ramey

No, note that the test_simple_class includes serialization of a wstring object and that it seems to work with all archive types
Are you including:
include <boost/serialization/string.hpp>
in your code?
Yes, its included. I'm not in front of the code base at the moment, so I can't look into how the test_simple_class deals with, but I will look at it Monday.
As a side note, I've tried to incorporate the wide version of the library and use that, but I'm running into a different batch of link errors:
Note that there are TWO serialization libraries. libboost_serialization includes all basic code for serialization as well as precompiled class for character mode i/o. libboost_wserialization includes precompiled classes for wide character i/o. This was done this way in order to a) simplify thngs for platforms which don't implement wide character i/o b) speed up things for those who don't use wide character i/o
So in addition to linking with libboost_serialization.lib, link with libboost_wserialization.lib as well
They are both included. I haven't had a chance to spend a whole lot of time looking at why I'm having issues with the wide version. Jared
participants (2)
-
Jared McIntyre
-
Robert Ramey