openssl 1.1.0e installation on macos 10.12(sierra)

openssl 1.1.0e installation on macos 10.12(sierra)

第1次尝试,失败:

./config –prefix=/usr
permission denied

sudo ./config –prefix=/usr
Configured

make
permission denied
sudo make
sudo make test
sudo make install

unable to create /usr/include

看来, macos不允许往/usr/安装东西,还是安装到默认的目录/usr/local/下吧:
重来

sudo make clean

./config
permission denied

sudo ./config

sudo make

sudo make test
md2 is not supported on this system
rc5 is not supported on this system

sudo make install

最终安装到了 /usr/local/下了
这样,机器上有两个版本的openssl可执行程序
一个是系统自带的,在/usr/bin/里面,一个在/usr/local/bin/里面

————

不过 Xcode 似乎无法访问 /usr/…下面的库文件
编译程序报错:

Undefined symbols for architecture x86_64:
“_AES_decrypt”, referenced from:
_main in main.o
“_AES_encrypt”, referenced from:
_main in main.o
“_AES_set_decrypt_key”, referenced from:
_main in main.o
“_AES_set_encrypt_key”, referenced from:
_main in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

在General下欲添加libcrypto.a到Frameworks里面,但弹出的对话框根本不允许访问/usr
怎么办?

按组合键(和在Finder里面Go to folder一样): Command+Shift+G
手工输入 /usr/local/lib/ 即可

Leave a Reply

Your email address will not be published. Required fields are marked *