“Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib” with Xcode 8

家住魔仙堡 提交于 2019-12-18 09:05:04

问题


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 ?

来源:https://stackoverflow.com/questions/43150655/library-not-loaded-usr-local-opt-openssl-lib-libssl-1-0-0-dylib-with-xcode-8

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!