nghttp2编译引起的gcc升级笔记

序言

公司最近项目的业务需要,需要使用nghttp2这个开源库。所以从github.com上下载了一个release版本的nghttp2,然后通过源码进行编译安装。

编译和编译出错定位与解决

  1. 下载源码包: wget https://github.com/nghttp2/nghttp2/releases/download/v1.42.0/nghttp2-1.42.0.tar.xz
  2. 解压:xz -d nghttp2-1.42.0.tar.xz && tar xf nghttp2-1.42.0.tar
  3. 生成Makefile: ./configure --prefix=/usr --libdir=/usr/lib64
  4. 编译: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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值