[Insight-users] Re: Compiling error (Linking error): ITK

Michael Bell michael.bell at acm.org
Thu Aug 3 10:38:09 EDT 2006


Amitesh,

Please post your makefile and the header file for IntensityManip. It
appears that you are not
linking in a necessary class, or you have misnamed something, but it
is hard to tell without more information.

michael
On 8/2/06, Amitesh Agarwal <amiteshagarwal at gmail.com> wrote:
> Hi All,
>
>  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.
>
>  With Best Regards
>
>  Amitesh
>
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
> [amitesh at mephisto gui]$ make
>  g++ imageprocessing.cpp
>  g++ OpenFile.cpp
>  g++ IntensityManip.cpp
>  Linking imageprocessing...
> 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> >)':
>  /home/amitesh/work/gui/imageprocessing.cpp:279: undefined
> reference to `IntensityManipClass< unsigned short>::IntensityManipClass()'
> 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> >)':
> /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> >)'
> 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> >)'
> 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> >)'
> 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> >)'
> 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> >)':
>  /home/amitesh/work/gui/imageprocessing.cpp:279: undefined
> reference to `IntensityManipClass< float>::IntensityManipClass()'
> 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> >)':
> /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> >)'
> 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> >) '
> 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> >)'
> 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> >)'
> 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> >)':
>  /home/amitesh/work/gui/imageprocessing.cpp:279: undefined
> reference to `IntensityManipClass< unsigned char>::IntensityManipClass()'
> 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> >)':
> /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> >)'
> 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> >)'
> 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> >)'
> 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 > >)'
>  collect2: ld returned 1 exit status
>  make: *** [imageprocessing] Error 1
>
>
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
>
>
>


--
michael.bell at acm.org


-- 
michael.bell at acm.org


More information about the Insight-users mailing list