为什么会出现此错误?c++库构建



我不知道为什么会出现这个错误。

我在centos 7上使用nghttp 2。

我的centos支持c++17

我忘了什么选择了吗?

请帮帮我。

谢谢。

usr/include/c++/4.8.2/bits/c++0x_warning.h:32:2:
错误:#error此文件要求编译器和库支持ISO c++2011标准。这种支持目前是实验性的,必须使用-std=c++11或-std=gnu++11编译器选项来启用。#error此文件需要编译器和库支持\^util.h:52:0中包含的文件中,来自util.cc:25template.h:44:19:警告:可变模板仅适用于-std=c++11或-std=gnu++11[默认启用]模板<类型名称。。。T>^模板.h:45:1:错误:">constexpr"未命名类型constexpr std::array<^模板.h:45:1:注意:C++11'constexpr'仅与-std=C++11或-std=gnu++11一起使用template.h:54:33:错误:">constexpr"未命名类型模板<typename T、size_T N>constexpr size_t array_size(t(&)[N]){^模板.h:54:33:注意:C++11'constexpr'仅与-std=C++11或-std=gnu++11一起使用template.h:58:33:错误:">constexpr"未命名类型模板<typename T、size_T N>constexpr size_t str_size(t(&)[N]){^模板.h:58:33:注意:C++11'constexpr'仅与-std=C++11或-std=gnu++11一起使用template.h:64:31:警告:可变模板仅适用于-std=c++11或-std=gnu++11[默认启用]模板<typename F,typename。。。T>结构延迟{^模板。h:65:11:错误:应为">"或">'before'&amp'令牌延时(F&&F,T&&…T)^模板。h:67:15:错误:应为">"或">'before'&amp'令牌Defer(Defer&&o)noexcept:f(std::move(o.f)){}^模板。h:67:18:错误:无效构造函数;你可能是指'nghttp2::Defer<F、 T>(const nghttp2::延迟<F,T>&)'Defer(Defer&&o)noexcept:f(std::move(o.f)){}^模板。h:67:18:错误:应为''在成员声明末尾template.h:67:20:错误:">noexcept"未命名类型Defer(Defer&&o)noexcept:f(std::move(o.f)){}^模板.h:70:9:错误:">ResultType"之前应为嵌套名称说明符使用ResultType=typename std::result_of<typename std::衰变<F>:类型(^模板.h:70:9:错误:在类作用域中使用非成员的声明template.h:70:20:错误:应为''='标记之前使用ResultType=typename std::result_of<typename std::衰变<F>:类型(^模板.h:70:20:错误:在">="标记之前应为不合格idtemplate.h:72:3:错误:命名空间">std"中的">函数"未命名类型std::函数<ResultType()>f^template.h:在构造函数'nghttp2::Defer<F、 T>:延时(F)':template.h:66:9:错误:class'nghttp2::Defer<F、 T>'没有任何名为'f'的字段:f(std::bind(std::forward<f>(f),std::forward<T>(t) …)){}^模板.h:66:11:错误:">bind"不是">std'的成员:f(std::bind(std::forward<f>(f),std::forward<T>(t) …)){}^模板。h:66:11:注意:建议的替代方案:在/usr/include/net/In.h:24:0中包含的文件中,从/usr/include/netdb.h:27,从util.h:35,来自util.cc:25:…

我忘记了任何选项?

你做到了,编译器告诉你这一点:

error:#error此文件要求编译器和库支持ISO C++2011标准。这种支持目前是实验性的,必须使用-std=c++11或-std=gnu++11编译器选项来启用


您可能使用的是一个非常旧的编译器(默认情况下是带有CentOS的编译器)。

您需要安装提供最新版本的Red Hat Developer Toolset,请参阅https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/有关更多详细信息:

开发工具集专为在CentOS或Red Hat Enterprise Linux平台上工作的开发人员设计。它提供了GNU编译器集合、GNU调试器以及其他开发、调试和性能监控工具的当前版本。

最新更新