Hi All,<br>
<br>
I am writing a multifile application using itk. The
individual classes and files are sound syntaxically but there is a
linking error which occurs after compiling individual files as shown
below. I think the error lies in the Makefile that I am using. As I
have not seen any example of Makefile, in ITK Examples or anywhere
else, which uses multiple files for creating an ITK application,
I was wondering if anyone else is facing the same problem or if anyone
has a solution to that. I hope to get a reply which solves my problems.<br>
<br>
With Best Regards<br>
<br>
Amitesh<br>
<br>
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------<br>[amitesh@mephisto gui]$ make
<br>
g++ imageprocessing.cpp<br>
g++ OpenFile.cpp<br>
g++ IntensityManip.cpp<br>
Linking imageprocessing...<br>
imageprocessing.o(.gnu.linkonce.t._Z17ParameterfileReadItEvPiPdS1_Ss+0x7f2):
In function `vo id ParameterfileRead<unsigned short>(int*,
double*, double*, std::basic_string<char, std::ch
ar_traits<char>, std::allocator<char> >)':<br>
/home/amitesh/work/gui/imageprocessing.cpp:279: undefined reference to
`IntensityManipClass< unsigned short>::IntensityManipClass()'<br>
imageprocessing.o(.gnu.linkonce.t._Z17ParameterfileReadItEvPiPdS1_Ss+0x857):
In function `vo id ParameterfileRead<unsigned short>(int*,
double*, double*, std::basic_string<char, std::ch
ar_traits<char>, std::allocator<char> >)':<br>
/home/amitesh/.local/include/InsightToolkit/Common/itkSmartPointer.h:143:
undefined referenc e to `IntensityManipClass<unsigned
short>::RescaleFilterClass(unsigned short, unsigned short ,
itk::SmartPointer<itk::Image<unsigned short, 3u> >)'<br>
imageprocessing.o(.gnu.linkonce.t._Z17ParameterfileReadItEvPiPdS1_Ss+0x8d7):/home/amitesh/.l
ocal/include/InsightToolkit/Common/itkSmartPointer.h:143: undefined
reference to `IntensityM anipClass<unsigned
short>::ShiftFilterClass(unsigned short, double,
itk::SmartPointer<itk::I mage<unsigned short, 3u> >)'<br>
imageprocessing.o(.gnu.linkonce.t._Z17ParameterfileReadItEvPiPdS1_Ss+0x935):/home/amitesh/.l
ocal/include/InsightToolkit/Common/itkSmartPointer.h:143: undefined
reference to `IntensityM anipClass<unsigned
short>::NormalizeFilterClass(itk::SmartPointer<itk::Image<unsigned
short, 3u> >)'<br>
imageprocessing.o(.gnu.linkonce.t._Z17ParameterfileReadItEvPiPdS1_Ss+0x993):/home/amitesh/.l
ocal/include/InsightToolkit/Common/itkSmartPointer.h:143: undefined
reference to `IntensityM anipClass<unsigned
short>::NegativeFilterClass(itk::SmartPointer<itk::Image<unsigned
short, 3u> >)'<br>
imageprocessing.o(.gnu.linkonce.t._Z17ParameterfileReadIfEvPiPdS1_Ss+0x7f7):
In function `vo id ParameterfileRead<float>(int*, double*,
double*, std::basic_string<char, std::char_traits <char>,
std::allocator<char> >)':<br>
/home/amitesh/work/gui/imageprocessing.cpp:279: undefined reference to
`IntensityManipClass< float>::IntensityManipClass()'<br>
imageprocessing.o(.gnu.linkonce.t._Z17ParameterfileReadIfEvPiPdS1_Ss+0x85e):
In function `vo id ParameterfileRead<float>(int*, double*,
double*, std::basic_string<char, std::char_traits <char>,
std::allocator<char> >)':<br>
/home/amitesh/.local/include/InsightToolkit/Common/itkSmartPointer.h:143:
undefined referenc e to
`IntensityManipClass<float>::RescaleFilterClass(float, float,
itk::SmartPointer<itk::Im age<float, 3u> >)'<br>
imageprocessing.o(.gnu.linkonce.t._Z17ParameterfileReadIfEvPiPdS1_Ss+0x8e2):/home/amitesh/.l
ocal/include/InsightToolkit/Common/itkSmartPointer.h:143: undefined
reference to `IntensityM
anipClass<float>::ShiftFilterClass(float, double,
itk::SmartPointer<itk::Image<float, 3u> >) '<br>
imageprocessing.o(.gnu.linkonce.t._Z17ParameterfileReadIfEvPiPdS1_Ss+0x940):/home/amitesh/.l
ocal/include/InsightToolkit/Common/itkSmartPointer.h:143: undefined
reference to `IntensityM
anipClass<float>::NormalizeFilterClass(itk::SmartPointer<itk::Image<float,
3u> >)'<br>
imageprocessing.o(.gnu.linkonce.t._Z17ParameterfileReadIfEvPiPdS1_Ss+0x99e):/home/amitesh/.l
ocal/include/InsightToolkit/Common/itkSmartPointer.h:143: undefined
reference to `IntensityM
anipClass<float>::NegativeFilterClass(itk::SmartPointer<itk::Image<float,
3u> >)'<br>
imageprocessing.o(.gnu.linkonce.t._Z17ParameterfileReadIhEvPiPdS1_Ss+0x7f2):
In function `vo id ParameterfileRead<unsigned char>(int*,
double*, double*, std::basic_string<char, std::cha
r_traits<char>, std::allocator<char> >)':<br>
/home/amitesh/work/gui/imageprocessing.cpp:279: undefined reference to
`IntensityManipClass< unsigned char>::IntensityManipClass()'<br>
imageprocessing.o(.gnu.linkonce.t._Z17ParameterfileReadIhEvPiPdS1_Ss+0x857):
In function `vo id ParameterfileRead<unsigned char>(int*,
double*, double*, std::basic_string<char, std::cha
r_traits<char>, std::allocator<char> >)':<br>
/home/amitesh/.local/include/InsightToolkit/Common/itkSmartPointer.h:143:
undefined referenc e to `IntensityManipClass<unsigned
char>::RescaleFilterClass(unsigned char, unsigned char, i
tk::SmartPointer<itk::Image<unsigned char, 3u> >)'<br>
imageprocessing.o(.gnu.linkonce.t._Z17ParameterfileReadIhEvPiPdS1_Ss+0x8d7):/home/amitesh/.l
ocal/include/InsightToolkit/Common/itkSmartPointer.h:143: undefined
reference to `IntensityM anipClass<unsigned
char>::ShiftFilterClass(unsigned char, double,
itk::SmartPointer<itk::Ima ge<unsigned char, 3u> >)'<br>
imageprocessing.o(.gnu.linkonce.t._Z17ParameterfileReadIhEvPiPdS1_Ss+0x935):/home/amitesh/.l
ocal/include/InsightToolkit/Common/itkSmartPointer.h:143: undefined
reference to `IntensityM anipClass<unsigned
char>::NormalizeFilterClass(itk::SmartPointer<itk::Image<unsigned
char, 3 u> >)'<br>
imageprocessing.o(.gnu.linkonce.t._Z17ParameterfileReadIhEvPiPdS1_Ss+0x993):/home/amitesh/.l
ocal/include/InsightToolkit/Common/itkSmartPointer.h:143: undefined
reference to `IntensityM anipClass<unsigned
char>::NegativeFilterClass(itk::SmartPointer<itk::Image<unsigned
char, 3u > >)'<br>
collect2: ld returned 1 exit status<br>
make: *** [imageprocessing] Error 1<br>
<br>