Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
986 views
in Technique[技术] by (71.8m points)

macos - "Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib" with Xcode 8

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 ?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...