找不到“openssl/rsa.h"文件 [英] 'openssl/rsa.h' file not found

查看:72
本文介绍了找不到“openssl/rsa.h"文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 ccavenue 作为支付网关.我在运行应用程序时遇到 "'openssl/rsa.h' file not found" 这个错误.

I am using ccavenue as the payment gateway. I am getting "'openssl/rsa.h' file not found" this error while running the application.

有没有办法通过 cocoapods 添加 openssl 或者避免这个问题.

Is there any way to add openssl via cocoapods or avoid this issue.

提前致谢.

推荐答案

如果你在 Mac/ios 开发中遇到过这个 sha.h not found 错误,那是因为 Apple 放弃了对 openssl 的支持.(我遇到了这个错误在我的 macOs-mojave 版本中)

If you have come across this sha.h not found error on a Mac/ios development, it is because Apple dropped support for openssl.(I faced this error in my macOs-mojave version)

参考此链接:https://www.anintegratedworld.com/mac-osx-fatal-error-opensslsha-h-file-not-found/

您可以按照以下提到的步骤解决此问题.

You can follow below mentioned steps as a work around for this issue.

  1. brew install openssl

  1. brew install openssl

  • 这会将名为 openssl 的文件夹安装到您的/usr/local/Cellar 文件夹(所有其他 brew 下载所在的文件夹)

2.cd/usr/local/include

2.cd /usr/local/include

3.ln -s ../opt/openssl/include/openssl .

3.ln -s ../opt/openssl/include/openssl .

  • 诀窍是进入您的 usr/local/includes 文件夹并创建一个符号链接(在 Windows 世界中也称为文件夹快捷方式)到您的 Cellar 文件夹.(第 2 步)

  • The trick though is to go into your usr/local/includes folder and create a symlink (aka folder shortcut in the windows world) to your Cellar folder. (Step 2)

ln 是创建一个链接,-s 表示它是符号.接下来我们要说的是目的地和 .(点)表示在当前目录中创建链接.(第 3 步)

ln is to create a link and -s means it is symbolic. Next we are saying what is the destination and the . (dot) indicates to create the link in the current directory. (Step 3)

现在,当您编译代码时,警告应该会消失,因为您的编译器将在此目录(许多标准目录之一)中搜索并通过快捷链接找到头文件 sha.h.

Now when you compile the code, the warning should disappear because your compiler will search in this directory (one of many standard directories) and find the header file sha.h via the shortcut link.

作为最佳实践,您可能应该运行一些其他命令:

You should probably run a few other commands as best practise:

  1. 酿造医生

  1. brew doctor

酿造更新

酿造升级

这将解决问题.

注意:当我尝试在 R 环境中安装RSclient"包时,我遇到了这个特殊问题(找不到 openssl/rsa.h 文件).

Note : I faced this particular issue (openssl/rsa.h file not found) when i was trying to install 'RSclient' package in my R environment.

这篇关于找不到“openssl/rsa.h"文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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