|
Boost Users : |
Subject: Re: [Boost-users] Help with Visual Studio settings for BoostSerialization
From: Abdullah ARSLAN (abdullaharslan_at_[hidden])
Date: 2010-12-04 18:49:21
you seem to be right.
I was using a header file for class declaration and a cpp file for
definition, when i moved everything to cpp file,
It worked.
But what is the problem? My header file contains
template<class Archive>
void serialize(Archive & ar, const unsigned int version);
and in cpp file
template<class Archive>
void g7GameObject::serialize(Archive & ar, const unsigned int version)
{
ar & height;
ar & width;
......
} // my class name is g7GameObject
and with above code i get following error
error LNK2019: unresolved external symbol "private: void __thiscall
g7GameObject::serialize....
What am i doing wrong
Abdullah Arslan
Software Engineering and Management Master Program, University of Göteborg
On Sat, Dec 4, 2010 at 7:13 PM, Robert Ramey <ramey_at_[hidden]> wrote:
> Abdullah ARSLAN wrote:
> > I am trying to implement very simple sample of boost serialization.
> > I have a sample class, class1. It only contains a simple int variable.
> > I followed the examples given here :
> > http://www.boost.org/doc/libs/1_45_0/libs/serialization/doc/index.html
> >
> >
> > I also think that i followed this guideline :
> > http://beta.boost.org/doc/libs/1_44_0/more/getting_started/windows.html
> > but i am not sure...
> >
> >
> > Here is the error i get:
> >
> >
> > error LNK2019: unresolved external symbol "private: void __thiscall
> > class1::serialize<class boost::archive::text.....
>
> This is likely an error in your application. class1::serialize<...> is not
> defined
> in the library or the serialization headers. It's missing from your
> application.
> You've used something like
>
> class1 c;
> ...
> ar << c
>
> but there is no
>
> classs class1 {
> ...
> template<class Archive>
> void serialization(Archive &ar, unsigned int version){
> ...
> }
> ...
> };
>
> Robert Ramey
>
>
> _______________________________________________
> 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