<div dir="ltr"><div>We have a link problem on Linux when using GDAL transiently. If we link the unit tests for a library which depends on GDAL, i.e. an executable which transiently depends on GDAL through our library, we get the following linker error:</div><div><br></div><span style="font-family:monospace">/usr/bin/ld: libs/ioimage/tests/CMakeFiles/tests_unit_ioimage.dir/unit/writers/test_geoTiffWriter.cpp.o: undefined reference to symbol 'dlerror@@GLIBC_2.2.5'<br></span><div><span style="font-family:monospace">/usr/bin/ld: /lib/x86_64-linux-gnu/libdl.so.2: error adding symbols: DSO missing from command line</span></div><div><br></div><div>We need to add <span style="font-family:monospace">-ldl</span> to the linker line after GDAL in order to resolve the linker problem. This can be done when adding the property</div><div><br></div><span style="font-family:monospace">  INTERFACE_LINK_LIBRARIES "dl"</span><br><div><br></div><div>to the GDAL::GDAL imported target in <span style="font-family:monospace">GDAL-targets-release.cmake</span> (this is a generated file); apparently it is not enough to add dl to the IMPORTED_LINK_DEPENDENT_LIBRARIES_RELEASE property.</div><br><div>Does GDAL depend publicly on dl?</div><div>We do not find the proper way to patch GDAL's CMake code to add that dependency in the generated config file.</div><div><br></div><div>Thanks</div><div>Javier<br></div><div><br></div><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature">.___ ._ ..._ .. . ._.  .___ .. __ . _. . __..  ... .... ._ .__<br>Entre dos pensamientos racionales <br>hay infinitos pensamientos irracionales.<br><br></div></div></div>