[Insight-users] compilation problem

Luis Ibanez luis.ibanez at kitware.com
Sun Jul 22 10:14:38 EDT 2007


Hi Fleming,

You are probably adding the libraries in the wrong order
in the CMake command TARGET_LINK_LIBRARIES.

Could you please post to the list that section of your
CMakeLists.txt file ?

Please note that in Unix the order of the libraries is
important. High level libraries must go first.


   Thanks


      Luis


-------------------------
Fleming, Matthew wrote:
> 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
> _______________________________________________
> Insight-users mailing list
> Insight-users at itk.org
> http://www.itk.org/mailman/listinfo/insight-users
> 


More information about the Insight-users mailing list