Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

configure fails with non-C++11 compatible compiler #44

Closed
pghmcfc opened this issue Feb 19, 2016 · 7 comments
Closed

configure fails with non-C++11 compatible compiler #44

pghmcfc opened this issue Feb 19, 2016 · 7 comments

Comments

@pghmcfc
Copy link

pghmcfc commented Feb 19, 2016

Regular configure tries to run the configure script in the test directory by default, and that requires C++11. Hence c-ares build is no longer compatible with a plain C89 compiler. Is there an easy way of turning this off short of hacking out the AC_CONFIG_SUBDIRS line for the test directory?

...
config.status: creating Makefile
config.status: creating libcares.pc
config.status: creating ares_config.h
config.status: creating ares_build.h
config.status: executing depfiles commands
config.status: executing libtool commands
=== configuring in test (/builddir/build/BUILD/c-ares-1.11.0/test)
configure: running /bin/sh ./configure --disable-option-checking '--prefix=/usr'  '--build=x86_64-redhat-linux-gnu' '--host=x86_64-redhat-linux-gnu' '--target=x86_64-redhat-linux-gnu' '--program-prefix=' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' '--includedir=/usr/include' '--libdir=/usr/lib64' '--libexecdir=/usr/libexec' '--localstatedir=/var' '--sharedstatedir=/usr/com' '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--disable-dependency-tracking' '--disable-silent-rules' '--disable-static' '--enable-shared' 'build_alias=x86_64-redhat-linux-gnu' 'host_alias=x86_64-redhat-linux-gnu' 'target_alias=x86_64-redhat-linux-gnu' 'CFLAGS=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic' --cache-file=/dev/null --srcdir=.
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 whether make supports nested variables... (cached) yes
checking for x86_64-redhat-linux-gnu-g++... no
checking for x86_64-redhat-linux-gnu-c++... no
checking for x86_64-redhat-linux-gnu-gpp... no
checking for x86_64-redhat-linux-gnu-aCC... no
checking for x86_64-redhat-linux-gnu-CC... no
checking for x86_64-redhat-linux-gnu-cxx... no
checking for x86_64-redhat-linux-gnu-cc++... no
checking for x86_64-redhat-linux-gnu-cl.exe... no
checking for x86_64-redhat-linux-gnu-FCC... no
checking for x86_64-redhat-linux-gnu-KCC... no
checking for x86_64-redhat-linux-gnu-RCC... no
checking for x86_64-redhat-linux-gnu-xlC_r... no
checking for x86_64-redhat-linux-gnu-xlC... no
checking for g++... g++
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 g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... none
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
configure: error: *** A compiler with support for C++11 language features is required.
configure: error: ./configure failed for test
@bagder
Copy link
Member

bagder commented Feb 19, 2016

Oh right. We should add an option to skip the tests... I'll work on a patch.

@bagder bagder closed this as completed in 10a1b7d Feb 19, 2016
@bagder
Copy link
Member

bagder commented Feb 19, 2016

Thanks for pointing this out. You can also just remove that AC_CONFIG_SUBDIRS([test]) line and rerun autoconf in your directory to get a quick fix.

@pghmcfc
Copy link
Author

pghmcfc commented Feb 19, 2016

Patch works fine thanks.

@nagaramvijay
Copy link

same error came while configuring the c-ares_1.11.0 with solaris_12.3 cc compiler. Even i tried removing the AC_CONFIG_SUBDIRS([test]) line in configure.ac file but the same issue again repeating.
I have added the lines which you have given even that doesn't worked out.

@pghmcfc
Copy link
Author

pghmcfc commented Mar 16, 2016

You need to run autoconf to generate a new configure script that incorporates the changes made in configure.ac.

@RogelioQuintanaRomero
Copy link

hi
solved the problem using the following url
http://hiltmon.com/blog/2015/08/09/c-plus-plus-11-on-centos-6-dot-6/

@cnrting
Copy link

cnrting commented Jun 5, 2018

yum install gcc-c++

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants