序言
公司最近项目的业务需要,需要使用nghttp2这个开源库。所以从github.com上下载了一个release版本的nghttp2,然后通过源码进行编译安装。
编译和编译出错定位与解决
- 下载源码包: wget https://github.com/nghttp2/nghttp2/releases/download/v1.42.0/nghttp2-1.42.0.tar.xz
- 解压:xz -d nghttp2-1.42.0.tar.xz && tar xf nghttp2-1.42.0.tar
- 生成Makefile: ./configure --prefix=/usr --libdir=/usr/lib64
- 编译:make -j4。说明一下,我的环境是4核的,所以用的"make -j4"。
本以为接下来就要进行“make install”啦。可是,我还是太天真啦(编译报错啦)。错误如下:
make[3]: Leaving directory `/root/nghttp2/nghttp2-1.42.0/src/includes'
make[3]: Entering directory `/root/nghttp2/nghttp2-1.42.0/src'
CXX util.o
CXX http2.o
CXX app_helper.o
CC nghttp2_gzip.o
In file included from /usr/include/c++/4.8.2/array:35:0,
from http2.h:34,
from http2.cc:25:
/usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the \
^
In file included from /usr/include/c++/4.8.2/cinttypes:35:0,
from app_helper.h:30,
from app_helper.cc:58:
/usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the \
^
In file included from /usr/include/c++/4.8.2/chrono:35:0,
from util.h:46,
from util.cc:25:
/usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2: error: #error This file requires compiler and library support for the ISO C++ 2011 standard. This support is currently experimental, and must be enabled with the -std=c++11 or -std=gnu++11 compiler options.
#error This file requires compiler and library support for the \
^
In file included from http2.h:41:0,
from http2.cc:25:
memchunk.h:452:30: error: invalid suffix "_k" on integer constant
using Memchunk16K = Memchunk<16_k>;
^
CXX nghttp.o
In file included from http2.h:41:0,
from app_helper.cc:60:
memch

最低0.47元/天 解锁文章
1234

被折叠的 条评论
为什么被折叠?



