ios - 为 Xcode 安装 OpenSSL 库

标签 ios xcode openssl static-libraries

我已经在 xcode 中安装了 OpenSSL 用于收据验证,但它不起作用。

我下载openssl.xcodeprojopenssl-1.0.1f 。我提取 openssl-1.0.1f 并添加 openssl.xcodeproj到我的项目。

files in finder inserted openssl.xcodeproj

我编辑Header Search Path至:

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

我添加了libcrypto.aTarget Dependencies在构建阶段下

并添加libcrypto.aLink Binary With Libraries

http://atastypixel.com/blog/easy-inclusion-of-openssl-into-iphone-app-projects/ 中所述.

但是当我构建项目时,它会因错误而停止:

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

为什么?

最佳答案

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

使用适用于 iOS 的 OpenSSL 预构建版本可能会更容易。您可以在此处找到一个Github account 。 Github 上的 OpenSSL 是多架构的。它们有 ARMv7、ARMv7s、ARM64 和 i386。这意味着它们可以与设备和模拟器一起使用。

下载 OpenSSL 1.0.1e 或 1.0.1f。将其安装在 /usr/local/ssl/ios 等位置。

然后,将 header 添加到您的 Xcode 项目中。它们位于/usr/local/ssl/ios/include:

enter image description here

最后,将多架构库(libcrypto.alibssl.a)添加到您的 Xcode 项目中。它们位于/usr/local/ssl/ios/lib:

enter image description here

关于ios - 为 Xcode 安装 OpenSSL 库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40171137/

相关文章:

php - 需要帮助理解 php 签名验证

html - 提供 html 文件预览的旋转木马

java - Java 中的 OpenSSL EVP_BytesToKey 问题

ios - 只能由静态库中的类访问的方法

android - 使用 Phonegap 为 iOS 、 Android 和 Windows 平台构建应用程序

ios - iOS9中如何呈现PopOver

ios - UITabBarController Tab Modal Presentation -Swift2 OS

ios - 如何在 Xcode 4.4 中将部署目标从 iOS 5.1 更改为 4.2

xcode - 使用 Mac Catalyst 上传新应用程序版本时出错

c# - 如何将文本字符串从 Base64 解码为字节数组,以及如何在不损坏数据的情况下获取此字节数组的字符串属性