Почему возникла эта ошибка? сборка библиотеки C++

Я не знаю, почему возникает эта ошибка.

Я использую nghttp2 на centos 7.

Мой centos поддерживает C++ 17

Я забыл какие-то варианты?

Помоги мне, пожалуйста.

Спасибо.

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 util.h:52:0,
                     from util.cc:25:
    template.h:44:19:warning: variadic templates only available with -std=c++11 or -std=gnu++11 [enabled by default]
     template <typename... T>
                       ^template.h:45:1:error: constexpr’ does not name a type
     constexpr std::array<
     ^template.h:45:1:note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
    template.h:54:33:error: constexpr’ does not name a type
     template <typename T, size_t N> constexpr size_t array_size(T (&)[N]) {
                                     ^template.h:54:33:note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
    template.h:58:33:error: constexpr’ does not name a type
     template <typename T, size_t N> constexpr size_t str_size(T (&)[N]) {
                                     ^template.h:58:33:note: C++11 ‘constexpr’ only available with -std=c++11 or -std=gnu++11
    template.h:64:31:warning: variadic templates only available with -std=c++11 or -std=gnu++11 [enabled by default]
     template <typename F, typename... T> struct Defer {
                                   ^template.h:65:11:error: expected ‘,’ or ‘...’ before ‘&&’ token
       Defer(F &&f, T &&... t)
               ^template.h:67:15:error: expected ‘,’ or ‘...’ before ‘&&’ token
       Defer(Defer &&o) noexcept : f(std::move(o.f)) {}
                   ^template.h:67:18:error: invalid constructor; you probably meant ‘nghttp2::Defer<F, T> (const nghttp2::Defer<F, T>&)’
       Defer(Defer &&o) noexcept : f(std::move(o.f)) {}
                      ^template.h:67:18:error: expected ‘;’ at end of member declaration
    template.h:67:20:error: noexcept’ does not name a type
       Defer(Defer &&o) noexcept : f(std::move(o.f)) {}
                        ^template.h:70:9:error: expected nested-name-specifier before ‘ResultType’
       using ResultType = typename std::result_of<typename std::decay<F>::type(
             ^template.h:70:9:error: using-declaration for non-member at class scope
    template.h:70:20:error: expected ‘;’ before ‘=’ token
       using ResultType = typename std::result_of<typename std::decay<F>::type(
                        ^template.h:70:20:error: expected unqualified-id before ‘=’ token
    template.h:72:3:error: function’ in namespace ‘std’ does not name a type
       std::function<ResultType()> f;
       ^template.h: In constructor ‘nghttp2::Defer<F, T>::Defer(F)’:
    template.h:66:9:error: class ‘nghttp2::Defer<F, T>’ does not have any field named ‘f’
           : f(std::bind(std::forward<F>(f), std::forward<T>(t)...)) {}
             ^template.h:66:11:error: bind’ is not a member of ‘std’
           : f(std::bind(std::forward<F>(f), std::forward<T>(t)...)) {}
               ^template.h:66:11:note: suggested alternative:
    In file included from /usr/include/netinet/in.h:24:0,
                     from /usr/include/netdb.h:27,
                     from util.h:35,
                     from util.cc:25:
    ...

Стоит ли изучать PHP в 2023-2024 годах?
Стоит ли изучать PHP в 2023-2024 годах?
Привет всем, сегодня я хочу высказать свои соображения по поводу вопроса, который я уже много раз получал в своем сообществе: "Стоит ли изучать PHP в...
Поведение ключевого слова "this" в стрелочной функции в сравнении с нормальной функцией
Поведение ключевого слова "this" в стрелочной функции в сравнении с нормальной функцией
В JavaScript одним из самых запутанных понятий является поведение ключевого слова "this" в стрелочной и обычной функциях.
Приемы CSS-макетирования - floats и Flexbox
Приемы CSS-макетирования - floats и Flexbox
Здравствуйте, друзья-студенты! Готовы совершенствовать свои навыки веб-дизайна? Сегодня в нашем путешествии мы рассмотрим приемы CSS-верстки - в...
Тестирование функциональных ngrx-эффектов в Angular 16 с помощью Jest
В системе управления состояниями ngrx, совместимой с Angular 16, появились функциональные эффекты. Это здорово и делает код определенно легче для...
Концепция локализации и ее применение в приложениях React ⚡️
Концепция локализации и ее применение в приложениях React ⚡️
Локализация - это процесс адаптации приложения к различным языкам и культурным требованиям. Это позволяет пользователям получить опыт, соответствующий...
Пользовательский скаляр GraphQL
Пользовательский скаляр GraphQL
Листовые узлы системы типов GraphQL называются скалярами. Достигнув скалярного типа, невозможно спуститься дальше по иерархии типов. Скалярный тип...
1
0
1 010
1
Перейти к ответу Данный вопрос помечен как решенный

Ответы 1

Ответ принят как подходящий

i forgot any options?

Вы это сделали, и компилятор вам точно сообщает:

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.


Вероятно, вы используете действительно старый компилятор (тот, который по умолчанию поставляется с CentOS).

Вам необходимо установить Red Hat Developer Toolset, который предоставляет последние версии, см. https://www.softwarecollections.org/en/scls/rhscl/devtoolset-7/ для получения дополнительных сведений:

Developer Toolset is designed for developers working on CentOS or Red Hat Enterprise Linux platform. It provides current versions of the GNU Compiler Collection, GNU Debugger, and other development, debugging, and performance monitoring tools.

Другие вопросы по теме