Boost logo

Boost :

Subject: Re: [boost] Serialization Link Error
From: Venkata (Ravi) Adusumilli (venkata.adusumilli_at_[hidden])
Date: 2009-01-16 13:46:28


Thanks Robert. It Worked.

On Fri, Jan 16, 2009 at 9:05 AM, Robert Ramey <ramey_at_[hidden]> wrote:

> add the following:
>
> #include <boost/archive/xml_oarchive.hpp>
> #include <boost/archive/xml_iarchive.hpp>
>
> as well as
>
> template void
>
> CommandRequest::serialize<boost::archive::xml_oarchive>(boost::archive::text_oarchive&
> archive, const unsigned int version);
> template void
>
> CommandRequest::serialize<boost::archive::xml_iarchive>(boost::archive::text_iarchive&
> archive, const unsigned int version);
>
>
> Robert Ramey
>
> Robert Ramey
> Venkata (Ravi) Adusumilli wrote:
> > Hi,
> > BOOST: 1.37
> > Linux version 2.6.9-efsm (root_at_vizzini) (gcc version 3.4.6 20060404
> > (Red Hat
> > 3.4.6-3)) #3 SMP Mon Dec 4 13:14:15 CST 2006
> >
> > I recieve the following link error:
> > *undefined reference to `void
> >
> CommandRequest::serialize<boost::archive::xml_iarchive>(boost::archive::xml_iarchive&,
> > unsigned int)'*
> >
> > while compiling the following class:
> >
> > ======H======
> > #include <boost/archive/text_oarchive.hpp>
> > #include <boost/archive/text_iarchive.hpp>
> > #include <boost/serialization/shared_ptr.hpp>
> >
> > class CommandRequest
> > {
> > public:
> > CommandRequest();
> > CommandRequest(int requestID, int commandType);
> > ~CommandRequest();
> > int requestID() const;
> > int commandType() const;
> >
> > protected:
> > int requestIDM;
> > int commandTypeM;
> > friend class boost::serialization::access;
> > template<class A>
> > void serialize(A& archive, const unsigned int);
> > };
> >
> > BOOST_SERIALIZATION_SHARED_PTR(CommunicationObjects::CommandRequest)
> >
> > ======CPP======
> > CommandRequest::CommandRequest()
> > : requestIDM(0),
> > commandTypeM(0)
> > {
> > }
> >
> > CommandRequest::CommandRequest(int requestID, int commandType)
> > : requestIDM(requestID),
> > commandTypeM(commandType)
> > {
> > }
> >
> > CommandRequest::~CommandRequest()
> > {
> > }
> >
> > int CommandRequest::requestID() const
> > {
> > return requestIDM;
> > }
> >
> > int CommandRequest::commandType() const
> > {
> > return commandTypeM;
> > }
> >
> > template<class A>
> > void CommandRequest::serialize(A & archive, const unsigned int /*
> > version */)
> > {
> > archive & requestIDM;
> > archive & commandTypeM;
> > }
> > template void
> >
> CommandRequest::serialize<boost::archive::text_oarchive>(boost::archive::text_oarchive&
> > archive, const unsigned int version);
> > template void
> >
> CommandRequest::serialize<boost::archive::text_iarchive>(boost::archive::text_iarchive&
> > archive, const unsigned int version);
> >
> >
> > Please let me know if you can help me out.
>
>
>
> _______________________________________________
> Unsubscribe & other changes:
> http://lists.boost.org/mailman/listinfo.cgi/boost
>

-- 
Thank You,
Venkata (Ravi) Adusumilli
-------------------------------------------------
"A happy New Year!
Grant that I May bring no tear to any eye
When this New Year in time shall end
Let it be said I've played the friend,
Have lived and loved and labored here,
And made of it a happy year."
~ Edgar Guest
-------------------------------------------------

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk