macOS brew 安装 openssl lib

brew install openssl

openssl已经安装成功,但是在程序引用时,仍然会报错无法找到openssl的头文件和库,这是因为brew安装到了

/usr/local/Cellar

目录下,需要建立两个软连接 ,即

在【/usr/local/include】目录建立openssl的目录软连接 :openssl -> ../Cellar/openssl/1.0.2q/include/openssl

在【/usr/local/lib】目录建立libssl.dylib和libcrypto.dylib的两个文件软连接 :

libcrypto.dylib -> ../Cellar/openssl/1.0.2q/lib/libcrypto.1.0.0.dylib

libssl.dylib -> ../Cellar/openssl/1.0.2q/lib/libssl.1.0.0.dylib

可以自动写代码了

➜  myopenssl g++ get_web_by_https.cc -lssl -lcrypto -o get_web_by_https

 

  • 2
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值