“ 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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章