<font face="arial,helvetica,sans-serif" color="#000000">Hello,<br />I have a problem with </font><font face="arial,helvetica,sans-serif" color="#000000">static </font><font face="arial,helvetica,sans-serif" color="#000000">linking ITK to a project. I build ITK with shared disabled on an Ubuntu system and my target link libs look like this (ordered like in my CMake):<br /><br />TARGET_LINK_LIBRARIES(myProject<br />Static_Libs/Itk/bin/libITKAlgorithms.a<br />Static_Libs/Itk/bin/libITKBasicFilters.a<br />Static_Libs/Itk/bin/libITKCommon.a<br />Static_Libs/Itk/bin/libITKDICOMParser.a<br />Static_Libs/Itk/bin/libITKEXPAT.a<br />Static_Libs/Itk/bin/libITKFEM.a<br />Static_Libs/Itk/bin/libitkgdcm.a<br />Static_Libs/Itk/bin/libITKIO.a<br />Static_Libs/Itk/bin/libitkjpeg12.a<br />Static_Libs/Itk/bin/libitkjpeg16.a<br />Static_Libs/Itk/bin/libitkjpeg8.a<br />Static_Libs/Itk/bin/libITKMetaIO.a<br />Static_Libs/Itk/bin/libitkNetlibSlatec.a<br />Static_Libs/Itk/bin/libITKniftiio.a<br />Static_Libs/Itk/bin/libITKNrrdIO.a<br />Static_Libs/Itk/bin/libITKNumerics.a<br />Static_Libs/Itk/bin/libitkopenjpeg.a<br />Static_Libs/Itk/bin/libitkpng.a<br />Static_Libs/Itk/bin/libITKSpatialObject.a<br />Static_Libs/Itk/bin/libITKStatistics.a<br />Static_Libs/Itk/bin/libitksys.a<br />Static_Libs/Itk/bin/libitktestlib.a<br />Static_Libs/Itk/bin/libitktiff.a<br />Static_Libs/Itk/bin/libitkv3p_lsqr.a<br />Static_Libs/Itk/bin/libitkv3p_netlib.a<br />Static_Libs/Itk/bin/libitkvcl.a<br />Static_Libs/Itk/bin/libitkvnl.a<br />Static_Libs/Itk/bin/libitkvnl_algo.a<br />Static_Libs/Itk/bin/libitkvnl_inst.a<br />Static_Libs/Itk/bin/libitkzlib.a<br />Static_Libs/Itk/bin/libITKznz.a)<br /><br />(I removed "/home/user/" in lib paths because I like my </font>anonymity :) <font face="arial,helvetica,sans-serif" color="#000000">)<br /><br />All I do in my actual project is to construct an itk::Image, so it is more like a test run to check<br />if static linking works: <br /><br />#include "itkImage.h"<br /><br />int main(int argc, char *argv[]) {<br /><br /> typedef itk::Image< unsigned short, 3 > ImageType;<br /> ImageType::Pointer image = ImageType::New();<br /><br /> return 1;<br />}<br /><br /><br />This gives errors in the linking process, any ideas why? Thoughts/Solutions highly welcome.<br />The following linking errors occur:<br /><br />Linking CXX executable myProject<br />Static_Libs/Itk/bin/libitksys.a(DynamicLoader.o): In function `itksys::DynamicLoader::OpenLibrary(char const*)':<br />DynamicLoader.cxx:(.text+0x15): undefined reference to `dlopen'<br />Static_Libs/Itk/bin/libitksys.a(DynamicLoader.o): In function `itksys::DynamicLoader::CloseLibrary(void*)':<br />DynamicLoader.cxx:(.text+0x2f): undefined reference to `dlclose'<br />Static_Libs/Itk/bin/libitksys.a(DynamicLoader.o): In function `itksys::DynamicLoader::GetSymbolAddress(void*, char const*)':<br />DynamicLoader.cxx:(.text+0x58): undefined reference to `dlsym'<br />Static_Libs/Itk/bin/libitksys.a(DynamicLoader.o): In function `itksys::DynamicLoader::LastError()':<br />DynamicLoader.cxx:(.text+0x6b): undefined reference to `dlerror'<br />collect2: ld returned 1 exit status<br />make[2]: *** [</font><font face="arial,helvetica,sans-serif" color="#000000">myProject</font><font face="arial,helvetica,sans-serif" color="#000000">] Error 1<br />make[1]: *** [CMakeFiles/</font><font face="arial,helvetica,sans-serif" color="#000000">myProject.</font><font face="arial,helvetica,sans-serif" color="#000000">dir/all] Error 2<br />make: *** [all] Error 2<br /><br />Thanks in advance,<br />JaBa<br /></font>