1

I am working to run "ogr2ogr" command in terminal. I got this error message.

dyld: Library not loaded: libcurl.4.dylib Referenced from: /usr/local/bin/ogr2ogr Reason: Incompatible library version: ogr2ogr requires version 8.0.0 or later, but libcurl.4.dylib provides version 7.0.0

There is a mismatch between the system requirement and library requirement. As I can tell, the latest curl is version 7 http://curl.haxx.se/download.html, why is this asking for version 8? I also tried to upgrade curl with brew but couldn't symlink into /usr/local, because would cause conflicts with the OS.

In order to figure this problem: I started by figuring out if the Curl is used by different

$$ Which curl /usr/bin/curl

I installed GDAL on mac by fellowing these instructions (StackOverFlow Post). To explore where the ogr2ogr is, I run the command. $$ which ogr2ogr /usr/local/bin/ogr2ogr

I fellowed these instructions :

  1. Download curl sources: http://curl.haxx.se/download/curl-7.25.0.zip
  2. Unarchive the zip file somewhere
  3. Open a Terminal window and go to the directory containing curl sources
  4. Type: CFLAGS=-m64 ./configure
  5. Type: make
  6. Type: sudo make install

Source :

But it doesn't work out.

Another approach I downloaded this file, unzip it into the bin/ directory, but when I tried to run it. I got this problem

../../bin/libcurl.4.dylib: cannot execute binary fil

There is one answer I found that seems very helpful, but I couldn't find it very practical.

If you didn't define the --with-curl option when running GDAL ./configure, then GDAL will link with the curl library indicated by "curl-config --libs" You likley have several libcurl on your system and the one that got used when linking GDAL is not the one available at runtime. The 8.0.0 or 7.0.0 don't necessarily reflect the "human readable" version of the curl library. It might be some other numbering scheme related to how the API/ABI of the library evolves, or something linked to packaging.

How can we do that in a practical way.

I read many articles before posting this question here, Anyone have any ideas on how to solve this problem ?

Community
  • 1
  • 1
user3001937
  • 2,005
  • 4
  • 19
  • 23

1 Answers1

0

Have you checked this out?

Python Anaconda linking

I did that, then simlinked some stuff:

ln -s libcurl.4.0.0.dylib libcurl.3.dylib

Another error came up, now pertaining to libxml2.

I did:

brew install libxml2 libxslt
brew link --force libxml2 libxslt

And now ogr2ogr is finally working

Community
  • 1
  • 1
pandorabob
  • 93
  • 4