macos - 无法读取opensslv.h :No such file or directory

标签 macos error-handling terminal openssl installation

当我尝试在MAC OS(Mountain Lion)终端上安装OpenSSL版本1.0.1h时出现以下错误,

unable to read opensslv.h:No such file or directory



我在终端中使用以下命令,
sudo /tmp/ssl/openssl-1.0.1h/Configure darwin64-x86_64-cc ––prefix=/usr no-threads shared

我正在按照this link上的说明进行操作。怎么了

最佳答案

I am following the instructions on this link. What is wrong here?



您没有按照说明进行操作。您好像错过了步骤06:
06. cd into openssl-1.0.0c as follow...

sudo /tmp/ssl/openssl-1.0.1h/Configure darwin64-x86_64-cc ––prefix=/usr no-threads shared



不要将makesudo一起使用。尝试这个:
/tmp/ssl/openssl-1.0.1h/Configure darwin64-x86_64-cc ––prefix=/usr no-threads shared
make -f /tmp/ssl/openssl-1.0.1h/Makefile
sudo make -f /tmp/ssl/openssl-1.0.1h/Makefile install

如果首先将cd转换为/tmp/ssl/openssl-1.0.1h/,通常会更容易。然后减少为:
tar xzf openssl-1.0.1h.tar.gz
cd openssl-1.0.1h
./Configure darwin64-x86_64-cc ––prefix=/usr no-threads shared
make
sudo make install

您还可以使用以下命令来避免记住三元组:
export KERNEL_BITS=64
./config shared no-threads shared no-ssl2 ...

进行安装后,除非使用/usr/local/ssl--openssldir进行更改,否则OpenSSL将安装在––prefix中。

sudo /tmp/ssl/openssl-1.0.1h/Configure darwin64-x86_64-cc ––prefix=/usr no-threads shared


––prefix=/usr可能会成为您的痛点。 Apple随附OpenSSL 0.9.8,它与OpenSSL 1.0.1h不二进制兼容。一旦将系统版本的OpenSSL替换为您的版本,您应该会遇到无法解释的崩溃和无法解释的错误结果。

最后,在sudo make install之前,您应该先make test以确保一切正常。

关于macos - 无法读取opensslv.h :No such file or directory,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24559703/

相关文章:

objective-c - 由于 URL 协议(protocol),NSApplicationDelegate 应用程序处于事件状态

macos - 在 OS X 上,我如何找出共享库与哪些 OS X 版本兼容?

python - Brew安装pip3,无法安装virtualenv

php - 一个视频如何用 ffmpeg 覆盖 2 个不同的视频?

internet-explorer - 如何在 Mac 上的 Microsoft Internet Explorer 中测试我的网页?

error-handling - 运行项目时vb6代码中的错误

java - 在这种情况下如何正确处理异常?

javascript - 错误子状态

linux - 不同终端的不同 nCurses 行为

MYSQL 终端 Mac 命令不工作 'mysql'