Reputation: 8730
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.
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 ?
Upvotes: 13
Views: 31422
Reputation: 102235
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
:
Finally, add the multi-arch libs (libcrypto.a
and libssl.a
) to your Xcode project. They are located in /usr/local/ssl/ios/lib
:
Upvotes: 17
Reputation: 102235
You need to add the library as a Framework. See this question: how to add an existing framework in Xcode 5.
Its OK to add the OpenSSL libraries under Frameworks. Its how things are done under Apple/Xcode.
I use the Absolute Path like in the image below because Crypto++, OpenSSL, etc are installed in /usr/local
. The image below is a screen capture I have handy of Crypto++, and not OpenSSL's libcrypto.a
or libssl.a
. But the same applies to all libraries.
Upvotes: 2