2

I'm writing a C program in Xcode that uses cURL. It builds properly on my Mac Pro running 10.8.5, but on my MacBook Pro running 10.8.5, it gives me this error when I try to build:

dyld: Library not loaded: /usr/local/opt/curl/lib/libcurl.4.dylib
  Referenced from: /Users/AlecZ/Library/Developer/Xcode/DerivedData/UPServer2-folctfcnmdhllzbddscwimqrggig/Build/Products/Debug/UPServer2
  Reason: Incompatible library version: UPServer2 requires version 8.0.0 or later, but libcurl.4.dylib provides version 7.0.0

The latest cURL is 7.37.0, so I don't see how it could require 8.0.0. I have run into similar issues before when trying to compile software for Linux from its source, the compiler stating that I need a nonexistent version of some library.

I have already run brew install libcurl, but it says that I can't replace the system library for cURL.

1

Try reinstalling curl package, e.g.

brew update
brew reinstall curl libcurl

This should fix the broken dependencies.

If this won't help, then try to comment out or remove any DYLD_LIBRARY_PATH, DYLD_FALLBACK_LIBRARY_PATH or DYLD_FRAMEWORK_PATH references from the startup shell scripts (e.g. ~/.bash_profile).

| improve this answer | |
  • It was a long time ago, but I think I had an unrelated problem. This should work. – sudo Nov 29 '16 at 2:32
-1

This is probably not the best solution, but I remembered this just as I was asking the question. After running brew install libcurl, I moved everything except pkgconfig from /usr/local/Cellar/curl/7.37.0/lib into /usr/lib, replacing old files. So I'm still at version 7.37.0, but it compiles properly now. I don't know what the compiler error was trying to say.

| improve this answer | |

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .