[Insight-users] compilation problem

Fleming, Matthew mfleming at mcw.edu
Wed Jul 18 12:10:53 EDT 2007


I am a trying to adapt an old application to use the ITK framework. Currently the application is set up as a static library that links to two object (*.o) files to create the executable. This was configured for cmake so that I can compile the sources for the object files and link them to the executable. As soon as I add any calls to ITK, however, I can't compile.

Specifically, when I just add

  typedef itk::Image<float, 2> ImageType;
  ImageType::Pointer itkImage = ImageType::New();

to one of the source files, when I make I get

/home/mfleming/InsightToolkit-3.2.0/build/bin/libitksys.a(DynamicLoader.o): In function `itksys::DynamicLoader::LastError()':
DynamicLoader.cxx:(.text+0x33): undefined reference to `dlerror'
/home/mfleming/InsightToolkit-3.2.0/build/bin/libitksys.a(DynamicLoader.o): In function `itksys::DynamicLoader::GetSymbolAddress(void*, char const*)':
DynamicLoader.cxx:(.text+0x4e): undefined reference to `dlsym'
/home/mfleming/InsightToolkit-3.2.0/build/bin/libitksys.a(DynamicLoader.o): In function `itksys::DynamicLoader::CloseLibrary(void*)':
DynamicLoader.cxx:(.text+0x6d): undefined reference to `dlclose'
/home/mfleming/InsightToolkit-3.2.0/build/bin/libitksys.a(DynamicLoader.o): In function `itksys::DynamicLoader::OpenLibrary(char const*)':
DynamicLoader.cxx:(.text+0x9f): undefined reference to `dlopen'
collect2: ld returned 1 exit status

evidently this is a problem with linking to ITK's dynamic libraries, but I have no idea how to fix it. I'd very much appreciate any assistance. I am working on Ubuntu Linux with ITK built from sources.

Thanks much,

Matthew Fleming


More information about the Insight-users mailing list