当我尝试在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
不要将
make
与sudo
一起使用。尝试这个:/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/