[Insight-users] Error using non-standard data type

Luis Ibanez luis.ibanez at kitware.com
Thu Jun 10 21:27:33 EDT 2004



Hi Reny,


There seems to be three different type
of link errors in your message.


A) The ones refering to DataObject,LightObject and
    ObjectFactoryBase are typical of having forgotten
    to add the "ITKCommon" library to the link line.

B) The ones relating to missing "type_info" are
    typical of having forgotten to enable RTTI
    in your compiler.

C) The one for itk::itkTFFT<float, 2>::itkTFFT(void)
    actually lead to suspect that you missed to
    implement the constructor of itkTFFT, or that
    you forgot to #include the .txx file from the
    .h file.



Errors (A) and (B) lead to suspect that you may not
be using CMake in order to configure your proyect.
CMake would have taken care of preventing these two
errors from happening.


A better diagnostic for Error (C) would require to
take a look at your code.



   Regards,



      Luis





-------------------------
reny at ctm.ulpgc.es wrote:

> Hi everybody:
> 
> I've been developing a class to manage tensors. I've tried to create a
> filter to implement a FFT on tensor fields.  The input and output to the
> filter are images which pixel type is my complex_tensor class.  When I
> try to compile a very simple example this error message arises:
> 
> TFFT_test.o: In function `itk::itkTFFT<float, 2>::New(void)':
> TFFT_test.o(.itk::itkTFFT<float, 2>::gnu.linkonce.t.New(void)+0x6c):
> undefined reference to `itk::itkTFFT<float, 2>::itkTFFT(void)'
> TFFT_test.o: In function
> `itk::ObjectFactory<itk::Image<complex_tensor<float>, 2>
> 
>>::Create(void)':
> 
> TFFT_test.o(.itk::ObjectFactory<itk::Image<complex_tensor<float>, 2>
> 
>>::gnu.linkonce.t.Create(void)+0x2b): undefined reference to
> 
> `itk::ObjectFactoryBase::CreateInstance(char const *)'
> TFFT_test.o(.itk::ObjectFactory<itk::Image<complex_tensor<float>, 2>
> 
>>::gnu.linkonce.t.Create(void)+0x5c): undefined reference to
> 
> `itk::LightObject type_info function'
> TFFT_test.o: In function `itk::ObjectFactory<itk::itkTFFT<float, 2>
> 
>>::Create(void)':
> 
> TFFT_test.o(.itk::ObjectFactory<itk::itkTFFT<float, 2>
> 
>>::gnu.linkonce.t.Create(void)+0x2b): undefined reference to
> 
> `itk::ObjectFactoryBase::CreateInstance(char const *)'
> TFFT_test.o(.itk::ObjectFactory<itk::itkTFFT<float, 2>
> 
>>::gnu.linkonce.t.Create(void)+0x5c): undefined reference to
> 
> `itk::LightObject type_info function'
> TFFT_test.o: In function `itk::ImageBase<2>::ImageBase(void)':
> TFFT_test.o(.itk::ImageBase<2>::gnu.linkonce.t.(void)+0xd): undefined
> reference to `itk::DataObject::DataObject(void)'
> TFFT_test.o(.itk::ImageBase<2>::gnu.linkonce.t.(void)+0x19e): undefined
> reference to `itk::DataObject::~DataObject(void)'
> 
> (And many other similar errors )
> 
> 
> It looks like a linking problem, but I don't know why.  I have made
> similar filters using standard data types and I had no problem. ITK
> provides templates to use any data type but, these data types have to be
> standard? Have I to write any code to make itk work with a new data
> type?
> 
> Thanks in advance.
> 
> Reny.
> 
> 
> 
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 





More information about the Insight-users mailing list