【问题标题】:unable to read opensslv.h:No such file or directory无法读取 opensslv.h:没有这样的文件或目录
【发布时间】:2014-08-24 22:21:33
【问题描述】:

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

无法读取opensslv.h:没有这样的文件或目录

我在终端中使用以下命令,

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

我正在按照this link 上的说明进行操作。这里有什么问题?

【问题讨论】:

  • 链接 http://foodpicky.com/?p=99 无效...

标签: macos error-handling terminal openssl installation


【解决方案1】:

我正在按照此链接上的说明进行操作。这里有什么问题?

您没有按照说明进行操作。看来您错过了第 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 ...

make install 后,OpenSSL 将安装在/usr/local/ssl 中,除非您将其更改为--openssldir––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 以确保一切正常。

【讨论】:

猜你喜欢
  • 2014-05-08
  • 2021-11-24
  • 2016-11-12
  • 2021-09-10
  • 2017-08-27
  • 1970-01-01
  • 2022-01-08
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多