[Insight-developers] Nonunit module dependency
David Doria
daviddoria at gmail.com
Mon Jul 18 17:21:52 EDT 2011
When trying to build some very simple code (below) that simply creates and
image and writes it with an ImageFileWriter, I get:
CMakeFiles/ImageFunctionImageFilter.dir/ImageFunctionImageFilter.cxx.o:(.data+0x50):
undefined reference to `itk::MRCImageIOFactoryRegister__Private()'
collect2: ld returned 1 exit status
I had built ITK with ITKGroup_Core and ITKGroup_IO ON. Once I turned
on ITKGroup_Nonunit, my code built fine.
1) Is there a reason for this dependency?
2) If so, could there be a better way to identify that a module is missing?
The link from the error "MRCImageIOFactoryRegister__Private" to the solution
of "turn on ITKGroup_Nonunit" is non-obvious.
David
(This is the code I used to test this:)
#include "itkImage.h"
#include "itkImageFileWriter.h"
typedef itk::Image< unsigned char, 2 > UnsignedCharImageType;
int main(int, char* [] )
{
UnsignedCharImageType::Pointer image = UnsignedCharImageType::New();
typedef itk::ImageFileWriter< UnsignedCharImageType > WriterType;
WriterType::Pointer writer = WriterType::New();
writer->SetFileName("ImageFunctionImageFilter.mhd");
writer->SetInput(image);
writer->Update();
return 0;
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.itk.org/mailman/private/insight-developers/attachments/20110718/70d0d4e2/attachment.htm>
More information about the Insight-developers
mailing list