如何以一种有效的方式在一个iOS项目中包含OpenSSL [英] How to include OpenSSL on an iOS project in a way that works

查看:1290
本文介绍了如何以一种有效的方式在一个iOS项目中包含OpenSSL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已按照网络上的所有教程执行此操作。一切正常,直到我在一个类上添加这一行:

I have followed all tutorials on the web to do this. Everything works fine, up to the point I add this line on a class:

#import <openssl/pkcs7.h>

然后我发现此错误'openssl / pkcs7.h'文件未找到

Xcode有多糟糕?我把每个文件拖到Xcode上都无法找到文件?

How bad can Xcode be? I drag every file to Xcode and the files cannot be found?

这是我现在的结构:


  1. 该应用有2个目标,必须在iPad上安装openSSL吗?

  2. 我使用过此脚本

  3. iPad目标位于跟随相对于基本目录路径的路径:Myapp ipad

  4. 该脚本生成了两个文件libcrypto.a和libssl.a。这两个文件都位于Mhapp ipad(=Myapp ipad / lib)中名为lib的目录中。

  5. 该脚本还生成了一个include / openssl目录,其中包含很多文件。我把它拖到了Myapp ipad。所以它现在在MyApp ipad / include

  1. the app has 2 targets, openSSL must be installed on the iPad one?
  2. I have used this script
  3. the iPad target is on the following path relative to the base directory path: "Myapp ipad"
  4. The script generated two files "libcrypto.a" and "libssl.a". Both files are inside a directory named "lib" inside "Mhapp ipad" (= "Myapp ipad/lib")
  5. The script also generated an "include/openssl" directory with a lot of files. I have dragged it to "Myapp ipad". So it is now at "MyApp ipad/include"

如何填写搜索路径,库搜索路径,无论如何使这个工作?

How do I fill the search paths, library search paths, whatever to make this work?

推荐答案

最简单的解决方案是使用CocoaPods - 有一个 OpenSSL pod ...

The easiest solution would be to use CocoaPods - there is an OpenSSL pod...

这篇关于如何以一种有效的方式在一个iOS项目中包含OpenSSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆