<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
  </head>
  <body>
    <p>Derek,</p>
    <p>This is intended. GDAL build shouldn't leak/expose internal
      implementation details such as its embedded shapelib copy, which
      doesn't belong to the GDAL API. Either you use the OGR Shapefile
      driver through OGR API, or you link against external shapelib if
      you want to use shapelib directly</p>
    <p>Note that <a class="moz-txt-link-freetext" href="https://github.com/OSGeo/gdal/pull/7973">https://github.com/OSGeo/gdal/pull/7973</a> is pending to
      fix the isolation of the embedded shapelib copy</p>
    <p>Even<br>
    </p>
    <div class="moz-cite-prefix">Le 21/06/2023 à 03:01, Derek Newhall a
      écrit :<br>
    </div>
    <blockquote type="cite"
cite="mid:CAA1reb1XnP5pf4mh23Tz4Buqx=gOvEg2vSKFFZStmrEgomx+Vw@mail.gmail.com">
      <meta http-equiv="content-type" content="text/html; charset=UTF-8">
      <style type="text/css">.style1 {font-family: "Times New Roman";}</style>
      <div dir="ltr">Hi all,<br>
        <br>
        We've just migrated from GDAL 3.5.1 to 3.7.0 which we build with
        (almost) all external dependencies as static libraries. However,
        we've noticed that when we try to compile our app against the
        resulting library the ESRI Shapefile API isn't available.<br>
        <br>
        Severity Code Description<br>
        Error LNK2001 unresolved external symbol DBFClose<br>
        Error LNK2001 unresolved external symbol SHPOpen<br>
        <snip><br>
        Error LNK2001 unresolved external symbol SHPCreateObject<br>
        Error LNK2001 unresolved external symbol SHPClose<br>
        <br>
        Looking at the .libs' symbols:<br>
        <br>
        DUMPBIN /linkermember D:\gdal-3.5.1\build\gdal_i.lib | sls DBF<br>
        <br>
           1ED958 DBFOpen<br>
           1ED958 __imp_DBFOpen<br>
           1ED9BC DBFOpenLL<br>
           1ED9BC __imp_DBFOpenLL<br>
           1ED3D0 DBFCreate<br>
           1ED3D0 __imp_DBFCreate<br>
           1ED436 DBFCreateEx<br>
           1ED436 __imp_DBFCreateEx<br>
        <snip 50+ lines><br>
             1257 __imp_DBFWriteNULLAttribute<br>
             1256 __imp_DBFWriteStringAttribute<br>
             125B __imp_DBFWriteTuple<br>
        <br>
        DUMPBIN /linkermember D:\gdal-3.7.0\build\gdal.lib | sls DBF<br>
        <br>
              DBF OSRGetAxesCount<br>
              DBF __imp_OSRGetAxesCount<br>
        <br>
        We build the DLL and apps with the following command in a .bat
        script (all library paths are valid and it compiles):<br>
        <br>
        cmake -G "Visual Studio 16 2019" -DBUILD_APPS=ON
        -DBUILD_SHARED_LIBS=ON ^<br>
        -DCMAKE_BUILD_TYPE=RelWithDebInfo
        -DCMAKE_PREFIX_PATH=D:\gdal-3.7.0-build ^<br>
        -DCMAKE_CXX_FLAGS="-DCURL_STATICLIB -DXML_STATIC"
        -DGDAL_USE_EXTERNAL_LIBS=OFF ^<br>
        -DOGR_BUILD_OPTIONAL_DRIVERS=ON ^<br>
        -DPROJ_INCLUDE_DIR="%~dp0proj-6.3.1\src" ^<br>
-DPROJ_LIBRARY_RELEASE="%~dp0proj-6.3.1\build_VS2017_x64\lib\RelWithDebInfo\proj.lib"
        ^<br>
        -DGDAL_USE_CURL=ON -DCURL_INCLUDE_DIR="%~dp0libcurl\include"
        -DCURL_LIBRARY_RELEASE="%~dp0libcurl\lib\libcurl.lib" ^<br>
        -DGDAL_USE_ECW=ON -DECW_INCLUDE_DIR="%~dp0ERDAS ECW JPEG 2000
        SDK 5.5.0\Desktop Read-Only\include" -DECW_LIBRARY="%~dp0ERDAS
        ECW JPEG 2000 SDK 5.5.0\Desktop
        Read-Only\lib\vc141\x64\NCSEcw.lib" ^<br>
        -DGDAL_USE_ODBC=ON ^<br>
        -DGDAL_USE_OPENSSL=ON
        -DOPENSSL_ROOT_DIR="%~dp0openssl-1.1.0f-vs2017"
        -DOPENSSL_USE_STATIC_LIBS=TRUE -DOPENSSL_MSVC_STATIC_RT=TRUE ^<br>
        -DGDAL_ENABLE_DRIVER_PDF_PLUGIN=ON ^<br>
        -DGDAL_USE_PDFIUM=ON
        -DPDFIUM_INCLUDE_DIR="%~dp0ExtractPDFium\install\include\pdfium"
         -DPDFIUM_LIBRARY="%~dp0ExtractPDFium\install\lib\pdfium.lib" ^<br>
        -DGDAL_USE_SQLITE3=ON
        -DSQLite3_INCLUDE_DIR="%~dp0sqlite-amalgamation-3370200"
         -DSQLite3_LIBRARY="%~dp0sqlite-amalgamation-3370200\sqlite3.lib"
        ^<br>
        -DGDAL_USE_XERCESC=ON
        -DXercesC_INCLUDE_DIR="%~dp0xerces-c-3.2.4\src"
        -DXercesC_LIBRARY="%~dp0xerces-c-3.2.4\build\src\Release\xerces-c_3.lib"
        ^<br>
        -DGDAL_USE_EXPAT=ON -DEXPAT_INCLUDE_DIR="%~dp0Expat\lib"
        -DEXPAT_LIBRARY="%~dp0Expat\RelWithDebInfo\libexpat.lib" ^<br>
        ..<br>
        <br>
        The build documentation at <a
          href="https://gdal.org/development/building_from_source.html"
          moz-do-not-send="true" class="moz-txt-link-freetext">https://gdal.org/development/building_from_source.html</a>
        says the ESRI Shapefile API cannot be disabled, so I'm wondering
        what's going on.  Is this a bug, or did we just misconfigure
        something? This is our first time semi-successfully building
        with the new CMake system.
        <div><br>
          Derek Newhall</div>
      </div>
      <br>
      <br>
      <p style="font-family: Verdana; font-size:10pt; color:#777777;"><b>Disclaimer</b></p>
      <p style="font-family: Verdana; font-size:8pt; color:#777777;">The
        information contained in this communication from the sender is
        confidential. It is intended solely for use by the recipient and
        others authorized to receive it. If you are not the recipient,
        you are hereby notified that any disclosure, copying,
        distribution or taking action in relation of the contents of
        this information is strictly prohibited and may be unlawful.</p>
      <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>