【问题标题】:cant compile MK-Livestatus because of c++17由于 c++17 无法编译 MK-Livestatus
【发布时间】:2018-12-05 10:27:42
【问题描述】:

我想在this insturctions 之后安装 MK-Livestatus 以将 t 与 nagios 和 thruk 连接起来。

当我尝试使用 ./configure && make 编译时 它说我:

    checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for gcc-8... no
checking for clang-7... no
checking for gcc-7... no
checking for clang-6.0... no
checking for clang-5.0... no
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
...
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether g++ supports C++17 features by default... no
checking whether g++ supports C++17 features with -std=c++17... no
checking whether g++ supports C++17 features with +std=c++17... no
checking whether g++ supports C++17 features with -h std=c++17... no
checking whether g++ supports C++17 features with -std=c++1z... no
checking whether g++ supports C++17 features with +std=c++1z... no
checking whether g++ supports C++17 features with -h std=c++1z... no
configure: error: *** A compiler with support for C++17 language features is required.

我已经搜索了如何编译它,但我从来没有找到有效的东西..

【问题讨论】:

标签: compiler-errors ubuntu-16.04 c++17 nagios


【解决方案1】:

您需要安装 gcc-7 或 gcc-8。我通过构建 Bionic 而不是 Xenial 解决了这个问题。要在 Xenial 上获取 gcc-7,请运行以下命令:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-7 g++-7
gcc-7 --version
# The following commands make gcc7/g++7 the defaults.
update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-7 60
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-7 60

这应该可以帮助您克服遇到的错误。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-07-18
    • 2020-07-06
    • 2018-07-04
    • 1970-01-01
    • 2019-09-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多