步骤
安装依赖
-
涉及的依赖比较多,参考官方文档
sudo apt-get install g++ make binutils autoconf automake autotools-dev libtool pkg-config \
zlib1g-dev libcunit1-dev libssl-dev libxml2-dev libev-dev libevent-dev libjansson-dev \
libc-ares-dev libjemalloc-dev libsystemd-dev libspdylay-dev \
cython python3-dev python-setuptools -
核对各种库的安装版本
- nghttp nghttp2/1.0.0 需要安装 OpenSSL 1.0.2g,版本,其他版本可能报错
- OpenSSL >= 1.0.1
- libev >= 4.11
- zlib >= 1.2.3
- libc-ares >= 1.7.5
配置
- 配置nghttp2时候,一定要确保./configure 期间没有报错,才可进行下一步
编译
- make 过程中遇到
/usr/bin/ld: /usr/local/lib/libcrypto.a(dso_dlfcn.o): undefined reference to symbol 'dlclose@@GLIBC_2.2.5'
- 原因是对应的库文件找不到symbol, libcrypto属于openssl.更换为OpenSSL 1.0.2g,问题解决
安装
- sudo make install