由于c ++ 17无法编译MK-Livestatus

时间:2018-12-05 10:27:42

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

我想在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.

我已经搜索了如何编译此文件,但从未发现有用的方法。

1 个答案:

答案 0 :(得分:0)

您需要安装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

这应该使您摆脱正在遇到的错误。