[Insight-users] problem with ImageHistogram2.cxx.

Luis Ibanez luis.ibanez at kitware.com
Thu Mar 25 18:31:04 EDT 2010


Hi Edoardo,


You are missing to link against the ITKStatistics library.

Please modify your CMakeLists.txt file.

Search for the command

            TARGET_LINK_LIBRARIE(   )

and add

                         "ITKStatistics"

to the list of libraries.


     Regards,


           Luis


-------------------------------------------------------------
On Thu, Mar 25, 2010 at 6:10 PM,  <edoardo.belletti at alice.it> wrote:
> Hi
> I have a problem: when I run the example
> Examples/Statistics/ImageHistogram2.cxx it return me this output:
>
> ~$ make
> Scanning dependencies of target Histogram
> [100%] Building CXX object CMakeFiles/Histogram.dir/Histogram.cxx.o
> Linking CXX executable Histogram
> CMakeFiles/Histogram.dir/Histogram.cxx.o: In function
> `itk::Statistics::DenseFrequencyContainer::New()':
> Histogram.cxx:(.text._ZN3itk10Statistics23DenseFrequencyContainer3NewEv[itk::Statistics::DenseFrequencyContainer::New()]+0x40):
> undefined reference to
> `itk::Statistics::DenseFrequencyContainer::DenseFrequencyContainer()'
> CMakeFiles/Histogram.dir/Histogram.cxx.o: In function
> `itk::ObjectFactory<itk::Statistics::DenseFrequencyContainer>::Create()':
> Histogram.cxx:(.text._ZN3itk13ObjectFactoryINS_10Statistics23DenseFrequencyContainerEE6CreateEv[itk::ObjectFactory<itk::Statistics::DenseFrequencyContainer>::Create()]+0xc):
> undefined reference to `typeinfo for
> itk::Statistics::DenseFrequencyContainer'
> Histogram.cxx:(.text._ZN3itk13ObjectFactoryINS_10Statistics23DenseFrequencyContainerEE6CreateEv[itk::ObjectFactory<itk::Statistics::DenseFrequencyContainer>::Create()]+0x4e):
> undefined reference to `typeinfo for
> itk::Statistics::DenseFrequencyContainer'
> CMakeFiles/Histogram.dir/Histogram.cxx.o: In function
> `itk::Statistics::Histogram<double, 1u,
> itk::Statistics::DenseFrequencyContainer>::GetFrequency(unsigned long
> const&) const':
> Histogram.cxx:(.text._ZNK3itk10Statistics9HistogramIdLj1ENS0_23DenseFrequencyContainerEE12GetFrequencyERKm[itk::Statistics::Histogram<double,
> 1u, itk::Statistics::DenseFrequencyContainer>::GetFrequency(unsigned long
> const&) const]+0x22): undefined reference to
> `itk::Statistics::DenseFrequencyContainer::GetFrequency(unsigned long)
> const'
> CMakeFiles/Histogram.dir/Histogram.cxx.o: In function
> `itk::Statistics::Histogram<double, 1u,
> itk::Statistics::DenseFrequencyContainer>::Initialize(itk::Size<1u>
> const&)':
> Histogram.cxx:(.text._ZN3itk10Statistics9HistogramIdLj1ENS0_23DenseFrequencyContainerEE10InitializeERKNS_4SizeILj1EEE[itk::Statistics::Histogram<double,
> 1u, itk::Statistics::DenseFrequencyContainer>::Initialize(itk::Size<1u>
> const&)]+0x1db): undefined reference to
> `itk::Statistics::DenseFrequencyContainer::Initialize(unsigned long)'
> CMakeFiles/Histogram.dir/Histogram.cxx.o: In function
> `itk::Statistics::Histogram<double, 1u,
> itk::Statistics::DenseFrequencyContainer>::IncreaseFrequency(unsigned long
> const&, float)':
> Histogram.cxx:(.text._ZN3itk10Statistics9HistogramIdLj1ENS0_23DenseFrequencyContainerEE17IncreaseFrequencyERKmf[itk::Statistics::Histogram<double,
> 1u, itk::Statistics::DenseFrequencyContainer>::IncreaseFrequency(unsigned
> long const&, float)]+0x29): undefined reference to
> `itk::Statistics::DenseFrequencyContainer::IncreaseFrequency(unsigned long,
> float)'
> CMakeFiles/Histogram.dir/Histogram.cxx.o: In function
> `itk::Statistics::Histogram<double, 1u,
> itk::Statistics::DenseFrequencyContainer>::SetToZero()':
> Histogram.cxx:(.text._ZN3itk10Statistics9HistogramIdLj1ENS0_23DenseFrequencyContainerEE9SetToZeroEv[itk::Statistics::Histogram<double,
> 1u, itk::Statistics::DenseFrequencyContainer>::SetToZero()]+0x18): undefined
> reference to `itk::Statistics::DenseFrequencyContainer::SetToZero()'
> collect2: ld returned 1 exit status
> make[2]: *** [Histogram] Errore 1
> make[1]: *** [CMakeFiles/Histogram.dir/all] Errore 2
> make: *** [all] Errore 2
>
> I have not changed anything about the code. But I don't know what is the
> problem.
>
> Thank you
> Best regards
> Edoardo
>
> _____________________________________
> 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://www.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-users
>
>


More information about the Insight-users mailing list