Xcode - 找不到“openssl/opensslconf.h”文件

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33484421/
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 08:09:32  来源:igfitidea点击:

Xcode - 'openssl/opensslconf.h' file not found

xcodeopenframeworks

提问by Jordi

I want to run the openFrameworks's examples following this tutorial (http://www.openframeworks.cc/setup/xcode/), but I have the following issue:

我想按照本教程(http://www.openframeworks.cc/setup/xcode/)运行 openFrameworks 的示例,但我有以下问题:

'openssl/opensslconf.h' file not found [enter image description here

找不到“openssl/opensslconf.h”文件[在此处输入图片说明

Anyone knows how to solve it?

有谁知道如何解决它?

Thanks!

谢谢!

采纳答案by bakercp

Coped from http://forum.openframeworks.cc/t/fix-for-xcode-7-and-of-0-8-4-opensslconf-h-not-found/20800

来自http://forum.openframeworks.cc/t/fix-for-xcode-7-and-of-0-8-4-opensslconf-h-not-found/20800

When building an OF 0.8.4 project with Xcode 7, you may see the following error:

'openssl/opensslconf.h' file not found

To fix this, open the file CoreOF.xcconfigin libs/openFrameworksCompiled/project/osx/and add the following line at the bottom:

USER_HEADER_SEARCH_PATHS = "$(OF_PATH)/libs/openssl/include"

If you understand the .xcconfig format, a cleaner fix would be to define a HEADER_OPENSSLvariable at the top of the file, and add it to the OF_CORE_HEADERSlist. The above fix should work fine, though.

使用 Xcode 7 构建 OF 0.8.4 项目时,您可能会看到以下错误:

找不到“openssl/opensslconf.h”文件

为了解决这个问题,打开该文件CoreOF.xcconfiglibs/openFrameworksCompiled/project/osx/,并在底部添加下面一行:

USER_HEADER_SEARCH_PATHS = "$(OF_PATH)/libs/openssl/include"

如果您了解 .xcconfig 格式,更简洁的解决方法是HEADER_OPENSSL在文件顶部定义一个变量,并将其添加到OF_CORE_HEADERS列表中。不过,上述修复应该可以正常工作。

回答by tball

This file is in /usr/include on OS X, but is not part of iOS. As the Apple docs state, it is possible to statically link OpenSSL into an iOS app, but they recommend using other security APIs instead.

此文件在 OS X 上的 /usr/include 中,但不是 iOS 的一部分。正如 Apple 文档所述,可以将 OpenSSL 静态链接到 iOS 应用程序,但他们建议改用其他安全 API。