[Insight-developers] Problme using tydef in own class

Luis Ibanez luis.ibanez at kitware.com
Sat Jan 8 16:25:41 EST 2011


Hi Martin,

Regarding the first link error,
You are probably missing to link to the ITKCommon library.

That's where the implementations of Zero, One are linked:

itkNumericTraitsArrayPixel.cxx
itkNumericTraitsCovariantVectorPixel.cxx
itkNumericTraits.cxx
itkNumericTraitsDiffusionTensor3DPixel.cxx
itkNumericTraitsFixedArrayPixel2.cxx
itkNumericTraitsFixedArrayPixel.cxx
itkNumericTraitsPointPixel.cxx
itkNumericTraitsRGBAPixel.cxx
itkNumericTraitsRGBPixel.cxx
itkNumericTraitsTensorPixel2.cxx
itkNumericTraitsTensorPixel.cxx
itkNumericTraitsVariableLengthVectorPixel.cxx
itkNumericTraitsVectorPixel.cxx


In your email, you truncated the second error message,
so we won't be able to help you with that one until you
post the full text of the error message.


   Thanks


     Luis


-----------------------------------
On Wed, Jan 5, 2011 at 7:09 PM, Martin Waitzbauer <mazzok at gmx.at> wrote:
> Hello
>
> Ive written a simple c++ class, which holds some itk filters
> I didnt derive it form any itk class, and i have problems using the typedef definitions of my ItkClassNameType.
>
> when o place them in the header file befor any class definition i get errors of that kind (and alot more)
>  error LNK2001: unresolved external symbol "public: static float const itk::NumericTraits<float>::Zero" (?Zero@?$NumericTraits at M@itk@@2MB)
>  error LNK2019: unresolved external symbol "private: class itk::SmartPointer<class itk::Image<float,3>
>
> seems like a static instatntiation problem
> so i placed them in the public: section of the *h file
> when i try to compile now i get errors in my *cpp file that the tyepdef Classes annot be found
>
>
> Can anyone give me a hint on that?
>
> Thanks!
> Regards
> Maz
> --
> Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!
> Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Kitware offers ITK Training Courses, for more information visit:
> http://kitware.com/products/protraining.html
>
> Please keep messages on-topic and check the ITK FAQ at:
> http://www.itk.org/Wiki/ITK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.itk.org/mailman/listinfo/insight-developers
>


More information about the Insight-developers mailing list