Boost logo

Boost Users :

From: Delfin Rojas (drojas_at_[hidden])
Date: 2004-11-10 11:19:50


I thought I should probably mention how I'm serializing this container. It
is something like this:

std::set<std::basic_string<wchar_t> > sMySet;

template<class TArchive>
void serialize(TArchive & ar, const unsigned int /* file_version */)
{
    ar & boost::serialization::make_nvp("my_set", m_sMySet);
}

And my archive is an xml archive.

Would it be possible that because this is a set of strings and in xml
everything has to be name/value pairs the serialization library simply
cannot serialize a set of strings because it does not know what name to give
in the xml to each element that hold every value of the set? If that is the
case how can I serialize this set? Do I have to iterate through it and
serialize it myself (provide the names myself)?
    
Once more the linker error is:

error LNK2019: unresolved external symbol "void __cdecl
boost::serialization::load<class boost::archive::xml_iarchive,class
std::list<class std::basic_string<wchar_t,struct
std::char_traits<wchar_t>,class std::allocator<wchar_t> >,class
std::allocator<class std::basic_string<wchar_t,struct
std::char_traits<wchar_t>,class std::allocator<wchar_t> > > > >(class
boost::archive::xml_iarchive &,class std::list<class
std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class
std::allocator<wchar_t> >,class std::allocator<class
std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class
std::allocator<wchar_t> > > > &,unsigned int)" ... referenced in function
"public: static void __cdecl boost::serialization::free_loader<class
boost::archive::xml_iarchive,class std::list<class
std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class
std::allocator<wchar_t> >,class std::allocator<class
std::basic_string<wchar_t,struct std::char_traits<wchar_t>,class
std::allocator<wchar_t> > > > >::invoke(class boost::archive::xml_iarchive
&,class std::list<class std::basic_string<wchar_t,struct
std::char_traits<wchar_t>,class std::allocator<wchar_t> >,class
std::allocator<class std::basic_string<wchar_t,struct
std::char_traits<wchar_t>,class std::allocator<wchar_t> > > > &,unsigned
int)"

Thanks

-delfin

> -----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