Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode 8 and "ld: library not found for -lcrypto"

When I try to build my project, I get the following issue.

ld: library not found for -lcrypto
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Before the latest Xcode update, I was using OpenSSL via CocoaPods just fine. After the latest OS and Xcode update, I can't seem to be able to build OpenSSL.

Any ideas how to solve this? On Xcode 7 everything was working ok.

like image 676
spacecash21 Avatar asked Oct 12 '16 16:10

spacecash21


2 Answers

Found a solution, turns out, I needed to update the CocoaPods as well as my Pods.

For Mac OS X: pod 'OpenSSL-OSX'

Other versions of OpenSSL do not work.

like image 145
spacecash21 Avatar answered Oct 15 '22 18:10

spacecash21


I struggled with this for a long time. I finally fixed it by adding the following path to Build Settings: Library Search Paths

$(SRCROOT)/../../openssl-1.0.1s-MacOSX/lib

Your folder path is probably different. I pressed the plus button and dragged the lib folder from the OpenSSL folder to it.

I am sure I had tried this multiple times without success, but it seems to fix it now.

like image 20
user2002649 Avatar answered Oct 15 '22 17:10

user2002649