configure error "A compiler with support for C++11 language features is required."
Asked Answered
M

4

12

I am trying to build the breakpad libraries based on the documentation from https://chromium.googlesource.com/breakpad/breakpad/ but when I execute ./configure && make, I get an error when checking for c++11, even though I am currently able to compile with c++11.

Here is the output from ./configure:

checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
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... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether UID '0' is supported by ustar format... yes
checking whether GID '0' is supported by ustar format... yes
checking how to create a ustar tar archive... gnutar
checking whether to enable maintainer-specific portions of Makefiles... no
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking for ar... ar
checking the archiver (ar) interface... ar
checking dependency style of gcc... gcc3
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking how to run the C preprocessor... gcc -E
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 for ranlib... ranlib
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for special C compiler options needed for large files... no
checking for _FILE_OFFSET_BITS value needed for large files... no
checking for the pthreads library -lpthreads... no
checking whether pthreads work without any flags... no
checking whether pthreads work with -Kthread... no
checking whether pthreads work with -kthread... no
checking for the pthreads library -llthread... no
checking whether pthreads work with -pthread... yes
checking for joinable pthread attribute... PTHREAD_CREATE_JOINABLE
checking if more special flags are required for pthreads... no
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking a.out.h usability... yes
checking a.out.h presence... yes
checking for a.out.h... yes
checking whether g++ supports C++11 features by default... no
checking whether g++ supports C++11 features with -std=c++11... no
checking whether g++ supports C++11 features with -std=c++0x... no
checking whether g++ supports C++11 features with +std=c++11... no
checking whether g++ supports C++11 features with -h std=c++11... no
configure: error: *** A compiler with support for C++11 language features is required.

Here is the output from g++ --version:

g++ (Debian 4.7.2-5) 4.7.2
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

And here is a sample application compiling with c++11:

g++ -std=c++11 -g -c -pedantic -Wall -Wextra -I../boost_1_57_0 -L../boost_1_57_0/stage/lib UtilsText.cpp -o UtilsText.o
g++ -std=c++11 -g -c -pedantic -Wall -Wextra -I../boost_1_57_0 -L../boost_1_57_0/stage/lib UtilsWeb.cpp -o UtilsWeb.o
g++ -std=c++11 -g -c -pedantic -Wall -Wextra -I../boost_1_57_0 -L../boost_1_57_0/stage/lib WorkElement.cpp -o WorkElement.o

I don't know why breakpad is complaining about my g++ not having support for c++11, or if there is a way I can override or add extra parameters so that it correctly detects my compiler.

Any hints on what I might be missing or doing wrong? Is breakpad using another gcc that might be installed in my system?

Here is the config.log file: http://pastebin.com/TuHrmiLv

Mold answered 14/6, 2016 at 8:34 Comment(2)
If you check config.log what does it say? It should show the actual commands used to try and compile.Averi
@JoachimPileborg I have added a link to the config log file. It has several errors when making tests regarding gcc, but it seems to be using the correct version. any tips?Mold
A
1

While GCC 4.7 does have some C++11 capabilities, it is severely lacking most of the features needed. So while the configure script uses the correct option to enable C++11, the compiler can't actually handle the test-program because it uses features not available in the old GCC 4.7 version you have.

If you want to use Breakpad you need either an older version of Breakpad that supports your old compiler, or you need to update your compiler to a more recent release. The 5 series should have full support for C++11.

Averi answered 14/6, 2016 at 9:9 Comment(1)
Thank you! I had to add other repositories to my debian system in order to be able to install gcc 5, which was not in the main repository. Compilation successful!Mold
N
32

maybe you need this,work for me

yum install gcc-c++
Norval answered 5/6, 2018 at 17:15 Comment(2)
apk add g++ for alpineAgnosia
apt install g++ for ubuntuFruiter
A
1

While GCC 4.7 does have some C++11 capabilities, it is severely lacking most of the features needed. So while the configure script uses the correct option to enable C++11, the compiler can't actually handle the test-program because it uses features not available in the old GCC 4.7 version you have.

If you want to use Breakpad you need either an older version of Breakpad that supports your old compiler, or you need to update your compiler to a more recent release. The 5 series should have full support for C++11.

Averi answered 14/6, 2016 at 9:9 Comment(1)
Thank you! I had to add other repositories to my debian system in order to be able to install gcc 5, which was not in the main repository. Compilation successful!Mold
R
0

For Fedora use:

sudo dnf install gcc-c++

Rush answered 29/7, 2020 at 12:9 Comment(0)
L
0

For Linux Mint 21.2, based on Ubuntu 22.04 LTS, based on Debian 12 (Bookworm), you may see an error like this:

...
checking dependency style of /usr/bin/clang++-17... gcc3
checking whether /usr/bin/clang++-17 supports C++14 features by default... yes
checking whether /usr/bin/clang++-17 supports C++11 library features by default... no
checking whether /usr/bin/clang++-17 supports C++11 library features with -stdlib=libc++... no
configure: error: *** A C++ library with support for C++11 features is required.

To fix it, run:

sudo apt install libc++-17-dev
Loram answered 5/3 at 22:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.