XCode 链接到 OpenSSL 库

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/20448909/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 04:24:12  来源:igfitidea点击:

XCode linking to OpenSSL library

xcodemacosopenssl

提问by Cocoa Puffs

I've got a project that needs to link against the openssl libraries, although when i compile i have some issues.

我有一个需要链接到 openssl 库的项目,尽管我在编译时遇到了一些问题。

#include <openssl/bn.h>
#include <openssl/md5.h>

initially told me openssl was not found, so i compiled it from source and copied the openssl directory into my project. The errors went away regarding the openssl, although I received a new error which stated:

最初告诉我找不到 openssl,所以我从源代码编译它并将 openssl 目录复制到我的项目中。有关 openssl 的错误消失了,尽管我收到了一个新错误,其中指出:

applink.c

Lexical or Preprocessor Issue
'io.h' file not found 

so this leads me to believe i'm not including the openssl library properly. can anyone give me some indication on how to accomplish this?

所以这让我相信我没有正确包含 openssl 库。谁能给我一些关于如何实现这一点的指示?

XCode version 5.0.2 / SDK = 10.8 / Target OS = 10.6 / i386 x84_86

XCode 版本 5.0.2 / SDK = 10.8 / 目标操作系统 = 10.6 / i386 x84_86

回答by Cocoa Puffs

Solved by linking:

通过链接解决:

libssl and libcrypto to target

回答by Rhythmic Fistman

I don't think 'io.h' is an OpenSSL file. Are there any spaces in your Header Search Paths in the project's Build Settings? If so quote them like so: "My OpenSSL/includes"

我不认为 'io.h' 是一个 OpenSSL 文件。项目的构建设置中的标题搜索路径中是否有空格?如果是这样引用它们:“我的 OpenSSL/包括”