<div><div style="font-size:inherit">
<div style="font-size:inherit">
<p dir="auto">The issue you’re encountering is due to passing directory paths instead of actual library files to CMake for GEOS and CURL. While CMake accepts these inputs during configuration, the linker (ld) expects specific library files (such as .so or .a), not directories, hence the “file format not recognized” error during the build stage.</p>
<p dir="auto"><span style="font-size:inherit">You have specified:</span><br></p>
<p></p><ul><li>
<p>GEOS_LIBRARY=/home/mazianos/build/geos-3.14.1/lib</p>
</li><li>
<p>CURL_LIBRARY_RELEASE=/home/mazianos/build/curl/lib</p>
</li></ul><p></p>
<p><br></p>
<p dir="auto">These should instead point to the actual library files inside those directories or rather than hardcoding conside using this to let cmake automatically detect its dependencies.</p>
</div>
</div><div style="font-size:inherit">
<div style="font-size:inherit">
<p dir="auto">CMAKE_PREFIX_PATH= "path1;path2" </p><p dir="auto">Thanks,</p><p dir="auto">Surendrakumar</p><p dir="auto">Geowgs84 Geospatial solutions</p><p dir="auto"><br></p><p dir="auto"><br></p>
</div>
</div><br></div><div><br><div class="gmail_quote gmail_quote_container"><div dir="ltr" class="gmail_attr">On Tue, 24 Mar 2026 at 3:55 AM, Even Rouault via gdal-dev <<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;padding-left:1ex;border-left-color:rgb(204,204,204)"><u></u>
<div>
<p>The various xxx_LIBRARY CMake variables must point to the
libXXXX.so file, not just the directory where it is.</p></div><div>
<div>Le 23/03/2026 à 23:16, Mazin Marwan via
gdal-dev a écrit :<br>
</div>
<blockquote type="cite">
<div dir="ltr">Hello all,
<div><br>
</div>
<div>I'm trying to build GDAL with GEOS and Curl among other
packages and I'm running into an error when trying to run
"cmake --build ."</div>
<div><br>
</div>
<div><font face="monospace" style="font-family:monospace;color:rgb(0,0,0)">[ 96%] Built target gcore_mdreader<br>
[ 96%] Linking CXX shared library libgdal.so<br>
/usr/bin/ld: cannot find /home/mazianos/build/curl/lib: file
format not recognized<br>
/usr/bin/ld: cannot find
/home/mazianos/build/geos-3.14.1/lib: file format not
recognized<br>
/usr/bin/ld: cannot find
/home/mazianos/build/geos-3.14.1/lib: file format not
recognized<br>
/usr/bin/ld: cannot find
/home/mazianos/build/geos-3.14.1/lib: file format not
recognized<br>
/usr/bin/ld: cannot find
/home/mazianos/build/geos-3.14.1/lib: file format not
recognized<br>
collect2: error: ld returned 1 exit status<br>
gmake[2]: *** [CMakeFiles/GDAL.dir/<a style="font-family:monospace">build.make:2788</a>:
libgdal.so.38.3.12.2] Error 1<br>
gmake[1]: *** [CMakeFiles/<a style="font-family:monospace">Makefile2:3352</a>:
CMakeFiles/GDAL.dir/all] Error 2<br>
gmake: *** [<a style="font-family:monospace">Makefile:146</a>: all] Error 2</font></div>
<div><font face="monospace" style="font-family:monospace;color:rgb(0,0,0)"><br>
</font></div>
<div><font face="arial, sans-serif" style="font-family:arial,sans-serif;color:rgb(0,0,0)">I'm not sure what's causing
this, but I had previously ran</font></div>
<div><font face="monospace" style="font-family:monospace;color:rgb(0,0,0)">sudo cmake
-DGEOS_INCLUDE_DIR=/home/mazianos/build/geos-3.14.1/include
\</font></div>
<div><font face="monospace" style="font-family:monospace;color:rgb(0,0,0)">-DGEOS_LIBRARY=/home/mazianos/build/geos-3.14.1/lib
\</font></div>
<div><font face="monospace" style="font-family:monospace;color:rgb(0,0,0)">-DGDAL_USE_HDF5=ON \</font></div>
<div><font face="monospace" style="font-family:monospace;color:rgb(0,0,0)">-DEXPAT_INCLUDE_DIR=/home/mazianos/build/expat/include
\</font></div>
<div><font face="monospace" style="font-family:monospace;color:rgb(0,0,0)">-DEXPAT_LIBRARY=/home/mazianos/build/expat/lib
\</font></div>
<div><font face="monospace" style="font-family:monospace;color:rgb(0,0,0)">-DCURL_INCLUDE_DIR=/home/mazianos/build/curl/include
\</font></div>
<div><font face="monospace" style="font-family:monospace;color:rgb(0,0,0)">-DCURL_LIBRARY_RELEASE=/home/mazianos/build/curl/lib
\</font></div>
<div><font face="monospace" style="font-family:monospace;color:rgb(0,0,0)">-DCMAKE_BUILD_TYPE=Release ..</font></div>
<div><font face="arial, sans-serif" style="font-family:arial,sans-serif;color:rgb(0,0,0)">successfully, so it's able
to find geos and curl.</font></div>
<div><font face="arial, sans-serif" style="font-family:arial,sans-serif;color:rgb(0,0,0)"><br>
</font></div>
<div><font face="arial, sans-serif" style="font-family:arial,sans-serif;color:rgb(0,0,0)">Any ideas on what I may have
done wrong on the way to this point would be appreciated.</font></div>
</div>
<br>
<fieldset></fieldset>
<pre style="font-family:monospace">_______________________________________________
gdal-dev mailing list
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank" style="font-family:monospace">gdal-dev@lists.osgeo.org</a>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank" style="font-family:monospace">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre cols="72" style="font-family:monospace">--
<a href="http://www.spatialys.com" target="_blank" style="font-family:monospace">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</div>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div></div>