<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p><br>
    </p>
    <div class="moz-cite-prefix">Le 29/04/2022 à 11:30, Javier Jimenez
      Shaw a écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:CADRrdKt8yuQ+KfFkJait8=kf-EROzGd17a+6UGA2Fa_kxjVgWQ@mail.gmail.com">
      <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>/usr/bin/ld:
libs/ioimage/tests/CMakeFiles/tests_unit_ioimage.dir/unit/writers/test_geoTiffWriter.cpp.o:
          undefined reference to symbol '<a class="moz-txt-link-abbreviated" href="mailto:dlerror@@GLIBC_2.2.5">dlerror@@GLIBC_2.2.5</a>'<br>
        </span>
        <div><span>/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>-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>  INTERFACE_LINK_LIBRARIES "dl"</span><br>
        <div><br>
        </div>
        <div>to the GDAL::GDAL imported target in <span>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>
    </blockquote>
    <p>Not that I'm aware of.</p>
    <p>Our CI runs ./autotest/postinstall/test_cmake.sh which in
      particular has a ./autotest/postinstall/test_cpp/CMakeLists.txt
      that has GDAL has a dependency</p>
    <p>Perhaps you could check how your setup is different from that ?<br>
    </p>
    <blockquote type="cite"
cite="mid:CADRrdKt8yuQ+KfFkJait8=kf-EROzGd17a+6UGA2Fa_kxjVgWQ@mail.gmail.com">
      <div dir="ltr">
        <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>
      <br>
      <fieldset class="moz-mime-attachment-header"></fieldset>
      <pre class="moz-quote-pre" wrap="">_______________________________________________
gdal-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/gdal-dev">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
    </blockquote>
    <pre class="moz-signature" cols="72">-- 
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
  </body>
</html>