Gcc g++ on cygwin - configure: error: *** A compiler with support for C++11 language features is req


Login or Register for Dates, Times and to Reply

 
Thread Tools Search this Thread
# 1  
Gcc g++ on cygwin - configure: error: *** A compiler with support for C++11 language features is req

Hi,

Apologies if I posted it in a wrong section as it is related to gcc on cygwin. Please move it to appropriate section.

I'm trying to compile and build libsigc++-2.10.2 on cygwin with gcc 8.3.0.

Quote:
$ gcc --version
gcc (GCC) 8.3.0
Copyright (C) 2018 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.
Quote:
$ g++ --version
g++ (GCC) 8.3.0
Copyright (C) 2018 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.
when I run ./configure, I get this:

Quote:
checking whether make supports the include directive... yes (GNU style)
checking dependency style of g++... gcc3
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++11... no
checking whether g++ supports C++11 features with -h 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++0x... no
checking whether g++ supports C++11 features with -h std=c++0x... no
configure: error: *** A compiler with support for C++11 language features is required.
I couldn't fully understand what does configure.log says here but it seems compiler admits that it is not ready for C++11?
I copied entire log to This file contains any messages produced by compilers while running configure, - Pastebin.com

Basically how could i make gcc 8.3.0 ready/compatible for C++11?

Please advise, thanks
# 2  
Let's check your compiler:
Can you compile a hello world program?
Use this example code:

Code:
    #include <iostream>
    using namespace std;
    int main()
    {
       cout << "Hello, World!";
       return 0;
    }

Save the file as hello.cpp
Compile and run with
Code:
g++ -o hello hello.cpp
./hello

Do you get any errors on either step?

If no errors, then compiler is okay. g++ and gcc behave differently with source files with a file extension of .c
g++ tries to compile .c files as as C++, not C. C syntax causes errors. Obviously because it is different from C++.

Try this as a compile:
Code:
g++ -std=c++0x -o hello hello.cpp

If this works we have to look elsewhere for what is happening. C11 is not normally turned on by default AFAIK. The successful second command turns it on and if it works the problem is likely NOT your compiler.

Last edited by jim mcnamara; 06-30-2019 at 11:03 PM..
These 2 Users Gave Thanks to jim mcnamara For This Post:
# 3  
Thank you Jim for your reply.

All 3 commands ran without any errors. Please see below:

Quote:
admin@HP-BIG-DESK ~
$ cat hello.cpp
#include <iostream>
using namespace std;
int main()
{
cout << "Hello, World!";
return 0;
}

admin@HP-BIG-DESK ~
$ g++ -o hello hello.cpp

admin@HP-BIG-DESK ~
$ ./hello
Hello, World!
admin@HP-BIG-DESK ~
$ g++ -std=c++0x -o hello hello.cpp

admin@HP-BIG-DESK ~
$ ./hello
Hello, World!
admin@HP-BIG-DESK ~
$
I compiled & built few other things which worked straight away but stuck up with libsigc++-2.10.2
# 4  
That looks like a library mismatch. You have proves your install is correct.
cygwin is installed by going to one of the cygwin mirror sites, downloading the installer and running it.

It shows what is installed. Try to update gcc. You may have updated some outside package which overwrote something you need. Try adding libgmp which will not hurt anything, but will check libraries it needs.

When you installed gcc or cygwin did you play around a lot with selecting things, cygwin sometimes breaks when you install oddball stuff. perl update once broke my gcc. perl is not oddball, really. But it is not part of the default install.

What I'm saying: this is hard to do sometimes. Cygwin has a listserv that you can search for known problems and fixes. Google for cygwin problems use the exact library name, too. It looks like you have already hit google and asked questions elsewhere. Expand the search.

Last edited by jim mcnamara; 07-01-2019 at 12:35 AM..
# 5  
Maybe just compile the executable outside your cygwin environment (with the correct architecture as a static executable without any dynamically loading libs) and then copy the binary into your cygwin environment.

Quote:
You can't always get what you want, but if you try sometimes, you just might get what you need. - Rolling Stones
# 6  
Quote:
Originally Posted by Neo
Maybe just compile the executable outside your cygwin environment (with the correct architecture as a static executable without any dynamically loading libs) and then copy the binary into your cygwin environment.
Not a bad idea, except I have noticed in the past, if one does and the OP needs piping capability on his/her C(++) incarnation it is not easy if at all possible to code for on say a native Windows C(++) compiling environment to run on a UNIX environment.
Be aware of this...
# 7  
Quote:
Originally Posted by wisecracker
Not a bad idea, except I have noticed in the past, if one does and the OP needs piping capability on his/her C(++) incarnation it is not easy if at all possible to code for on say a native Windows C(++) compiling environment to run on a UNIX environment.
Be aware of this...
Yeah, it was a long shot, as I have no idea about anything on Windows, including Cygwin.

I thought, maybe wrong, that as long as the architecture was the same (CPU family and number of bits, I assume 64 bit), that if you use gcc to compile a static binary on one, it should run on the other.

I am probably way off and totally wrong.
Login or Register for Dates, Times and to Reply

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #879
Difficulty: Easy
Supervisory Control and Data Authorization (SCADA) is a control system architecture .
True or False?

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

cc compiler and gcc compiler

hi, can we install gcc compiler in unix based OS(sun solar,IBM AIX,HP,etc) and also can we install sun cc compiler in AIX environment and vice versa. and more ..is linux support cc compiler regards Ajay (3 Replies)
Discussion started by: ajaysahoo
3 Replies

2. Programming

gcc compiler

Which gcc compiler release had the Arm 9 multicore support?Whether the compiler that used for the single Arm 9 core can be used for its multicore systems ? If gcc not support,please tell me which are the compilers that are available for Arm 9 multicore systems (including commerical).Whether... (0 Replies)
Discussion started by: sujith4u87
0 Replies

3. UNIX for Dummies Questions & Answers

GCC compiler Ld fatal error

Hi all I'm trying to install sudo. When I first ran the sudo configure script it errored saying that I didn't have a C compiler. I have since installed the GCC 3.4.6 package for sol8 from sun freeware. Doing that resolved the no C complier found error. I was then getting an error saying... (1 Reply)
Discussion started by: Donkey25
1 Replies

4. Ubuntu

./configure command Error while trying to install GCC compiler on unix machine

Hi, I need to install the GCC compiler on a my Linus machine. First step is to run the ./configure command and here we need to specify ./configure --target="target machine name (CPU type-Manufacturer-OS) or other way would be just give the command ./configure and it guesses the target name... (11 Replies)
Discussion started by: viji19812001
11 Replies

5. HP-UX

gcc error..compiler cannot create executables

Hi I have locally compiled and installed gcc-4.1.2 in directory /usr/local/pkg/gcc/4.1.2/bin/gcc I want to compile beecrypt using this new compiler , So i have done setenv CC usr/local/pkg/gcc/4.1.2/bin/gcc ( Note this configuration is running properly with older version of... (1 Reply)
Discussion started by: vasanthan
1 Replies

6. Programming

New to C/gcc compiler - compile error.

I am new to comiling c/c++ programs with gcc compilier unix - AIX version 5.3 gcc compiler version - 4.0.0 My makefile. # makefile 1.0 08/20/98 #CC = cc CC = gcc ESQL = esql CFLAGS = -Wall DBSLIB= DBSLIB=-L${INFORMIXDIR}/lib/esql -L${INFORMIXDIR}/lib `esql -libs` ALL = hds_near... (9 Replies)
Discussion started by: anish
9 Replies

7. UNIX for Dummies Questions & Answers

xl C/C++ compiler to GCC compiler

Hi, we are converting from IBM-AIX(xl c/c++ compiler) to Linux(GCC complier). As a part of this i need to change the CFLAGS. The xl c/c++ complier CFLAGS is CFLAGS := $(CDEBUG) $(PROJECT_INCLUDE_DIRS) $(COBJECT_MODE) -qcpluscmt -qmakedep -qcheck=all \ -qalign=bit_packed $(LINT_FLAGS)... (0 Replies)
Discussion started by: pbattu1
0 Replies

8. Programming

gcc compiler

i write c++ code it run perfectely with g++ compiler but same code when i compile with GCC compiler it gives linker error , followed these linker error /tmp/ccfZtXOQ.o(.text+0x22): In function `main': conf_system.cpp: undefined reference to `operator new(unsigned int)'... (5 Replies)
Discussion started by: munnu
5 Replies

9. UNIX for Dummies Questions & Answers

cc compiler / gcc

:confused: I have a question concerning gcc. IŽd like to install the gcc on my Mac OS X, but when I try to run the configure command I get the following message: floriant% ./configure ./configure: read-only variable: PWD Configuring for a powerpc-apple-darwin5.4 host. *** This configuration... (2 Replies)
Discussion started by: florian.turck
2 Replies

Featured Tech Videos