[Insight-users] Link error WatershedImageFilter (ITK version 3.16.0)
O'Connor, Michael
Michael.OConnor at umassmed.edu
Mon Feb 28 10:37:35 EST 2011
Hi,
I was unsuccessful in adding a WatershedImageFilter to my image processing code. That code uses many ITK (version 3.16.0) objects so I believe my issue is specific to the WatershedImageFilter. I resorted to simply trying to compile/link the Toolkit example (WatershedSegmentation2.cxx). I get the following link error message (same link error that I get when making my code). I've excerpted just the Watershed code from the example (in code snippet below) and I get the same error again. I am unfamiliar with error messages that I am getting (below) regarding WatershedMiniPipelineProgressCommand()
Any suggestions would be appreciated.
Regards,
Mike
***********************MAKE ERROR MESSAGE**********************
-bash-3.2$ make
Scanning dependencies of target WS
[100%] Building CXX object CMakeFiles/WS.dir/foo.cxx.o
Linking CXX executable WS
CMakeFiles/WS.dir/foo.cxx.o: In function `itk::ObjectFactory<itk::WatershedMiniPipelineProgressCommand>::Create()':
foo.cxx:(.text._ZN3itk13ObjectFactoryINS_36WatershedMiniPipelineProgressCommandEE6CreateEv[itk::ObjectFactory<itk::WatershedMiniPipelineProgressCommand>::Create()]+0x10): undefined reference to `typeinfo for itk::WatershedMiniPipelineProgressCommand'
foo.cxx:(.text._ZN3itk13ObjectFactoryINS_36WatershedMiniPipelineProgressCommandEE6CreateEv[itk::ObjectFactory<itk::WatershedMiniPipelineProgressCommand>::Create()]+0x51): undefined reference to `typeinfo for itk::WatershedMiniPipelineProgressCommand'
CMakeFiles/WS.dir/foo.cxx.o: In function `itk::WatershedImageFilter<itk::Image<float, 3u> >::GenerateData()':
foo.cxx:(.text._ZN3itk20WatershedImageFilterINS_5ImageIfLj3EEEE12GenerateDataEv[itk::WatershedImageFilter<itk::Image<float, 3u> >::GenerateData()]+0x122): undefined reference to `typeinfo for itk::WatershedMiniPipelineProgressCommand'
CMakeFiles/WS.dir/foo.cxx.o: In function `itk::WatershedMiniPipelineProgressCommand::WatershedMiniPipelineProgressCommand()':
foo.cxx:(.text._ZN3itk36WatershedMiniPipelineProgressCommandC1Ev[itk::WatershedMiniPipelineProgressCommand::WatershedMiniPipelineProgressCommand()]+0x1c): undefined reference to `vtable for itk::WatershedMiniPipelineProgressCommand'
collect2: ld returned 1 exit status
make[2]: *** [WS] Error 1
make[1]: *** [CMakeFiles/WS.dir/all] Error 2
make: *** [all] Error 2
******************CODE ***********************************
/*=========================================================================
CODE snippet extracted from
Program: Insight Segmentation & Registration Toolkit
Module: WatershedSegmentation2.cxx
=========================================================================*/
#include "itkWatershedImageFilter.h"
#include "itkImage.h"
int main( int argc, char *argv[] )
{
typedef float InternalPixelType;
const unsigned int Dimension = 3;
typedef itk::Image< InternalPixelType, Dimension > InternalImageType;
//
// Instantiate the Watershed filter
//
typedef itk::WatershedImageFilter<
InternalImageType
> WatershedFilterType;
WatershedFilterType::Pointer watershedFilter = WatershedFilterType::New();
return 0;
}
More information about the Insight-users
mailing list