I have written a c++template class, I want to separate declaration and implementation into two file(".h,
.cc"). As that, when referencing to this class that I exported into
shared linked library(so) in Linux, the compiler indicated "the
undefined reference to these member function in that class". If I put both the declaration and implementation into one file, it works well.<br>
I have searched this problem in Google and there is two solutions, one
is to write declaration and implementation in one header file; the
other is to use the C++ keyword "export", but it seems that GNU does
not support this keyword. Only few C++ compilers support this.<br>
I found in the source code of ITK, it separate the declaration and
implementation of the template class into separated file(.h file and .cc file). So can anyone give me some suggestions for this problem. Thanks a lot for your help.<br>Weidong<br>