strange serialization compilation issue - serialize function not being compiled
Hi,
I have a class which has got the serialize function implemented.
template<class Archive>void myClassB::serialize( Archive& ar,
const
unsigned int)
Somehow, this function is skipped and doesn't appear even in the object
file created for this file which gives me undefined reference errors
later when linking.
I have included :
#include
G, Benjamin (NSN - IN/Bangalore) wrote:
Hi,
I have a class which has got the serialize function implemented.
template<class Archive>void myClassB::serialize( Archive& ar,
const unsigned int)
Somehow, this function is skipped and doesn't appear even in the object file created for this file which gives me undefined reference errors later when linking.
I have included :
#include
#include
#include
#include
In my cpp file.
Does this sound faimiliar to anyone? Or am I going wrong somewhere?
It is generally best to include a minimal program that reproduces a problem, and specify how you compile that program. - Volodya
AMDG G, Benjamin (NSN - IN/Bangalore) wrote:
I have a class which has got the serialize function implemented.
template<class Archive>void myClassB::serialize( Archive& ar, const unsigned int)
Somehow, this function is skipped and doesn't appear even in the object file created for this file which gives me undefined reference errors later when linking.
I have included :
#include
#include #include #include In my cpp file.
Does this sound faimiliar to anyone? Or am I going wrong somewhere?
Function templates usually need to be defined in the header file. If you define it in the cpp file, you need to use explicit instantiation. In Christ, Steven Watanabe
participants (3)
-
G, Benjamin (NSN - IN/Bangalore)
-
Steven Watanabe
-
Vladimir Prus