Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing OpenSSL library for Xcode

I have installed OpenSSL in xcode for receipt validation, but it doesn't work.

I download openssl.xcodeproj and openssl-1.0.1f. I extract openssl-1.0.1f and add openssl.xcodeproj to my project.

files in finderinserted openssl.xcodeproj

I edit the Header Search Path to :

 /Users/marko/Documents/Razvoj/BIView\ Mobile\ New\ Version/openssl/include/openssl

I added libcrypto.a in Target Dependencies under Build Phases

and added libcrypto.a in Link Binary With Libraries

as was described in http://atastypixel.com/blog/easy-inclusion-of-openssl-into-iphone-app-projects/.

But when I build project it stops with error :

clang: error: no such file or directory: '/Users/ .... -bmgslnakszsfovecplbzoslykrxo/Build/Products/Debug-iphoneos/libcrypto.a'

Why ?

like image 228
Marko Zadravec Avatar asked Mar 27 '14 15:03

Marko Zadravec


1 Answers

OK, how to build and install it....

It might be easier to use a pre-built version of OpenSSL for iOS. You can find one at this Github account. The OpenSSL from that Github are multi-arch. They have ARMv7, ARMv7s, ARM64, and i386. That means they work with devices and simulators.

Download either OpenSSL 1.0.1e or 1.0.1f. Install it in a location like /usr/local/ssl/ios.

Then, add the headers to your Xcode project. They are located in /usr/local/ssl/ios/include:

enter image description here

Finally, add the multi-arch libs (libcrypto.a and libssl.a) to your Xcode project. They are located in /usr/local/ssl/ios/lib:

enter image description here

like image 183
jww Avatar answered Oct 29 '22 21:10

jww