Problem loading dynamic library linked to ITK from a program also linked to ITK

Hello all,

I am trying to load at runtime a dynamic library using ITK (let’s call it
lib.so), within a program also linked to ITK.
To do this, I am using :

void* handle = dlopen("lib.so", RTLD_LOCAL | RTLD_LAZY)

but it crashes (I receive an H5::DataSpaceIException).

This works when I remove linking to ITK from the program that use the
library, or when I remove it from the library itself, so I guess I have
conflicting links between both programs, but I can’t figure it out.

Thank you !

Hello @Baptiste!

Were you using ITK Git master? The latest ITK Git master and ITK 4.13.1 both have fixes for the HDF5 library symbol name mangling, which could possibly be related. They are worth a try. Or, set ITK_USE_SYSTEM_HDF5 and point the build system to a system HDF5.

HTH,
Matt

Hello @matt.mccormick,

I was already using ITK 4.13.1, but I tried with ITK_USE_SYSTEM_HDF5 option and it works, I can now load the library.

Thanks a lot for your answer !
Baptiste

1 Like