“Library not loaded: /usr/local/opt/openssl/lib/li

2019-01-28 20:34发布

My project requires OpenSSL libraries crypto and ssl. After updating Xcode to 8.2.1, it broke my project and I'm not able to compile it anymore.

In my project Build Settings, in Linking, I have -lssl -lcrypto -lxml2 that indicates to load those 2 libraries. Going back to my app Build Settings, I add /usr/local/opt/openssl/lib/ in the Library Search Paths to tell Xcode where to look.

Hurray, it compiles, builds and run properly. Cool.

BUT

When launching the app on a different mac, the app crashes, with that message:

Dyld Error Message:
  Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /Applications/MyApp.app/Contents/MacOS/MyApp
  Reason: image not found

Well, that's not cool at all. That means the app is trying to load the open ssl libs that might not be present on that mac. There might be just an older version, or that folder might not exist at all ? So that's definitely a no-solution.

Here lies my issue, I have no idea how to solve that.

Removing -lssl -lcrypto from the linking doesn't help, as the code it makes the code throwing errors.

I guess I need a way to tell Xcode to look there when compiling only. Would that be possible ?

0条回答
登录 后发表回答