Hello,
I've have defined some templates in a .h file and implemented some of the declared functions in a separate .cpp file.
The problem is that the linker recognizes all those functions implemented in the .h
files (i.e. inline functions), but does not recognize the
ones in the .cpp files.
An example:
######################################################
"A.h" file:
template<T>
class A
{
void afunction(T xx){do_something(xx);} // This is ok
}
#######################################################
But if I have:
#####################################################
"A.h" file:
template<T>
class A
{
void afunction(T xx);
}
"A.cpp" file:
template<T> //This function is not recognized !!!
void A<T>::afunction(T xx)
{
do_something(xx);
}
#########################################################
Can anyone help me on that ?
Thanks!!!!
I've have defined some templates in a .h file and implemented some of the declared functions in a separate .cpp file.
The problem is that the linker recognizes all those functions implemented in the .h
files (i.e. inline functions), but does not recognize the
ones in the .cpp files.
An example:
######################################################
"A.h" file:
template<T>
class A
{
void afunction(T xx){do_something(xx);} // This is ok
}
#######################################################
But if I have:
#####################################################
"A.h" file:
template<T>
class A
{
void afunction(T xx);
}
"A.cpp" file:
template<T> //This function is not recognized !!!
void A<T>::afunction(T xx)
{
do_something(xx);
}
#########################################################
Can anyone help me on that ?
Thanks!!!!