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@rrsd.com> 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@lists.boost.org
http://lists.boost.org/mailman/listinfo.cgi/boost-users