“ fatal error: openssl/ssl.h: No such file or directory “错误解决

今天在 CentOS 7.6 上编译 HAProxy 1.9.4 版本的时候发生如下错误

[root@JasonSong haproxy-1.9.4]# make clean
[root@JasonSong haproxy-1.9.4]# make -j 8 TARGET=linux2628 USE_OPENSSL=1 USE_PCRE=1 USE_ZLIB=1
  CC      src/ev_poll.o
  CC      src/ev_epoll.o
  CC      src/ssl_sock.o
  CC      src/proto_http.o
  CC      src/cfgparse-listen.o
  CC      src/proto_htx.o
  CC      src/stream.o
In file included from include/types/global.h:32:0,
                 from src/ev_epoll.c:26:
include/types/listener.h:29:25: fatal error: openssl/ssl.h: No such file or directory
 #include <openssl/ssl.h>
                         ^
compilation terminated.
In file included from include/types/global.h:32:0,
                 from src/ev_poll.c:26:
include/types/listener.h:29:25: fatal error: openssl/ssl.h: No such file or directory
 #include <openssl/ssl.h>
                         ^
compilation terminated.
src/ssl_sock.c:42:24: fatal error: openssl/bn.h: No such file or directory
 #include <openssl/bn.h>
                        ^
compilation terminated.
In file included from include/types/proxy.h:34:0,
                 from include/proto/log.h:34,
                 from include/common/cfgparse.h:30,
                 from src/cfgparse-listen.c:14:
include/common/regex.h:31:18: fatal error: pcre.h: No such file or directory
 #include <pcre.h>

要解决这个问题,你需要安装 OpenSSL 开发包,执行以下命令进行安装,然后重新编译即可解决

CentOS系统执行以下命令

[root@JasonSong haproxy-1.9.4]# sudo yum install openssl-devel

Ubuntu系统执行以下命令

[root@JasonSong haproxy-1.9.4]# sudo apt-get install libssl-dev

查看我本人更多原创文章,请点击这里

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值