Boost logo

Boost Users :

From: Vyacheslav E. Andrejev (vandrejev_at_[hidden])
Date: 2004-11-12 07:56:19


Hello Delfin,

This error neither depends on the way you are trying to serialize the set (list, vector, etc...) or whether serialization library is built. I had the same problem and post the report about the probable reasons of bug along with suggestion how to fix it in gmane.comp.lib.boost.devel. This issue is still unresolved. The quick workaround for you is to define BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP in your project. This will force load and save methods to be defined in the serialization namespace, otherwise they would be defined in the std namespace that cause the error in linker.

-- 
Vyacheslav E. Andrejev
System Architect, Excelsior, LLC
DR> I thought I should probably mention how I'm serializing this
DR> container. It is something like this:
DR> 
DR> std::set<std::basic_string<wchar_t> > sMySet;
DR> 
DR> template<class TArchive>
DR> void serialize(TArchive & ar, const unsigned int /* file_version */)
DR> {
DR> ar & boost::serialization::make_nvp("my_set", m_sMySet);
DR> }
DR> And my archive is an xml archive.
DR> 
DR> Would it be possible that because this is a set of strings and in
DR> xml everything has to be name/value pairs the serialization library
DR> simply cannot serialize a set of strings because it does not know
DR> what name to give in the xml to each element that hold every value
DR> of the set? If that is the case how can I serialize this set? Do I
DR> have to iterate through it and serialize it myself (provide the
DR> names myself)?
DR> 
DR> Once more the linker error is:
DR> 
DR> error LNK2019: unresolved external symbol "void __cdecl
DR> boost::serialization::load<class boost::archive::xml_iarchive,class
DR> std::list<class std::basic_string<wchar_t,struct
DR> std::char_traits<wchar_t>,class std::allocator<wchar_t> >,class
DR> std::allocator<class std::basic_string<wchar_t,struct
DR> std::char_traits<wchar_t>,class std::allocator<wchar_t> > > >
DR> >(class boost::archive::xml_iarchive &,class std::list<class
DR> std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class
DR> std::allocator<wchar_t> >,class std::allocator<class
DR> std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class
DR> std::allocator<wchar_t> > > > &,unsigned int)" ... referenced in
DR> function "public: static void __cdecl
DR> boost::serialization::free_loader<class
DR> boost::archive::xml_iarchive,class std::list<class
DR> std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class
DR> std::allocator<wchar_t> >,class std::allocator<class
DR> std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class
DR> std::allocator<wchar_t> > > > >::invoke(class
DR> boost::archive::xml_iarchive &,class std::list<class
DR> std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class
DR> std::allocator<wchar_t> >,class std::allocator<class
DR> std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class
DR> std::allocator<wchar_t> > > > &,unsigned int)"
DR> 
DR> Thanks
DR> 
DR> -delfin
DR> 
>> -----Original Message-----
>> From: boost-users-bounces_at_[hidden] [mailto:boost-users-
>> bounces_at_[hidden]] On Behalf Of Delfin Rojas
>> Sent: Wednesday, November 10, 2004 7:44 AM
>> To: boost-users_at_[hidden]
>> Subject: RE: [Boost-users] Re: Serialization linker error question
>> Yes and yes. I am aware boost::serialization needs to be built. If I
>> were not building it the number of linker errors would be a lot more
>> ;)
>> 
>> Anyway, I built the serialization static libs (no dll seems to be
>> available
>> at this time) and I'm linking against it. However I got the linker
>> error I
>> mentioned before. It seems for some reason I cannot serialize this
>> container
>> (set of wstrings). I also tried changing it to a list of wstrings and
>> got
>> a
>> similar unresolved external. If I try to not serialize the container
>> my
>> program links perfectly.
>> Sorry my original post was in reply to a completely different one.
>> That
>> was
>> my lazy way to get the email address in the "to" box. I changed the
>> title
>> but I forgot to delete the body of the previous email as I always do.
>> Anyway, any help you guys can give me? I can try to come up with a
>> small example of my problem if you guys need it.
>> 
>> Thanks
>> 
>> -delfin
>> 
>>> -----Original Message-----
>>> From: boost-users-bounces_at_[hidden] [mailto:boost-users-
>>> bounces_at_[hidden]] On Behalf Of Jonathan Turkanis
>>> Sent: Tuesday, November 09, 2004 7:58 PM
>>> To: boost-users_at_[hidden]
>>> Subject: [Boost-users] Re: Serialization linker error question
>>> "Delfin Rojas" <drojas_at_[hidden]> wrote in message
>>> news:200411100255.iAA2tMji021179_at_patti.moodlogic.com...
>>> 
>>>> Hello boost,
>>>> 
>>> Hi,
>>> 
>>>> I started using the new serialization library. I use it to
>>>> serialize a
>>>> 
>>> class
>>> 
>>>> which contains, among other things, a
>>>> 
>>> std::set<std::basic_string<wchar_t> >
>>> 
>>>> The project compiles just fine with many warnings because RTTI is
>>>> not
>>>> 
>>> turned
>>> 
>>>> on but it compiles. However it does not link. I get this error:
>>>> 
>>> Are you aware that unlike much of boost, the serialization library
>>> contains
>>> implementation files that must be built?
>>>> Sorry for the length of the error. Anyway, I am using VC++ 7.1. I
>>>> 
>> don't
>> 
>>> know
>>> 
>>>> if it matters but my project has the "Treat wchar_t as built in
>>>> type"
>>>> 
>>> option
>>> 
>>>> turned on.
>>>> 
>>>> Any idea what am I doing wrong? Thanks,
>>>> 
>>> BTW, you have sent your post as a reply to a post on a completely
>>> different
>>> subject.
>>>> -delfin
>>>> 
>>> Jonathan
>>> 
>>> _______________________________________________
>>> Boost-users mailing list
>>> Boost-users_at_[hidden]
>>> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>> _______________________________________________
>> Boost-users mailing list
>> Boost-users_at_[hidden]
>> http://lists.boost.org/mailman/listinfo.cgi/boost-users

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