为Xcode安装OpenSSL库 [英] Installing OpenSSL library for Xcode
问题描述
我在xcode中安装了OpenSSL以进行收据验证,但它不起作用。
I have installed OpenSSL in xcode for receipt validation, but it doesn't work.
我下载 openssl.xcodeproj
和 openssl-1.0.1f
。我提取openssl-1.0.1f并将 openssl.xcodeproj
添加到我的项目中。
I download openssl.xcodeproj
and openssl-1.0.1f
. I extract openssl-1.0.1f and add openssl.xcodeproj
to my project.
我编辑标题搜索路径
到:
/Users/marko/Documents/Razvoj/BIView\ Mobile\ New\ Version/openssl/include/openssl
我添加 libcrypto.a
在目标依赖项
下的构建阶段
并添加 libcrypto.a
in Link Binary With Libraries
,如< a href =http://atastypixel.com/blog/easy-inclusion-of-openssl-into-iphone-app-projects/\"rel =noreferrer> 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'
为什么?
推荐答案
好的,如何构建和安装它....
OK, how to build and install it....
使用预构建版本的OpenSSL for iOS可能更容易。您可以在此 Github帐户找到一个。来自Github的OpenSSL是多拱的。它们具有ARMv7,ARMv7,ARM64和i386。这意味着它们可以使用设备和模拟器。
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.
下载OpenSSL 1.0.1e或1.0.1f。将它安装在类似 / usr / local / ssl / ios
的位置。
Download either OpenSSL 1.0.1e or 1.0.1f. Install it in a location like /usr/local/ssl/ios
.
然后,将标题添加到您的Xcode项目。它们位于 / usr / local / ssl / ios / include
:
Then, add the headers to your Xcode project. They are located in /usr/local/ssl/ios/include
:
最后,添加多拱库( libcrypto.a
和 libssl.a
)到你的Xcode项目。它们位于 / usr / local / ssl / ios / lib
:
Finally, add the multi-arch libs (libcrypto.a
and libssl.a
) to your Xcode project. They are located in /usr/local/ssl/ios/lib
:
这篇关于为Xcode安装OpenSSL库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!