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.

when I run ./configure, I get this:

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

Let's check your compiler:
Can you compile a hello world program?
Use this example code:

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

Save the file as hello.cpp
Compile and run with

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:

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.

2 Likes

Thank you Jim for your reply.

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

I compiled & built few other things which worked straight away but stuck up with libsigc++-2.10.2

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.

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...

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.

You are not entirely wrong, just that one anomaly to be able to pipe if necessary.
Most - if not all - native Windows _apps_ will launch happily from CygWin but don't expect to be able to pipe into SoundRecorder.exe for example like this and expect it to work:
echo " \/FILE waveform.wav \/DURATION 0000:00:02" | /full/path/to/SoundRecorder.exe

cygwin runs using the windows api, via a sort of translation library: UNIX -> intermediate libraries -> windows. It is an elf executable.

Thanks everyone for your replies. I see it now more complicated.

The latest version of GCC available through Cygwin is 8.3.0 hence I tried to compile 9.1.0 from source. But I get some errors, even though I installed gmp , mpfr & mpc and set their paths in configure and also via Environmental variables it still throws the same errors.

Maybe you can move off Window's based CygWin and on to a real unix-like operating system :slight_smile:

From the CygWin site:

If you truly want full gcc capability, move to Linux and off Windows :slight_smile:

Please note. This question is in the "UNIX for Advanced & Expert Users" forum, but this is not a "UNIX for Advanced & Expert Users" question, it is a Windows Cygwin question.

We are not a "Windows" forum, to be honest.

1 Like

Thanks Neo, will do.

Probably I will try Windows Subsystem for Linux (WSL).

Best regards,

Welcome.

FYI, I never use Windows for anything.

Linux for servers (like this site and other servers). MacOS for desktop work (actually, I have four Macs, one 12 core MacPro, one MacMini and two Mac Book Airs).

Today I just bought a new 1TB (actually 960GB, Transcend 855) SSD for my MacPro and installed it already (removing the original 256GB drive), and it works great.

Now that I have more "on board" SSH (internal), it renders video (Adobe After Effects) about twice as fast. One complex (lots of effects) video which took 1.5 hours to render, before the upgrade, rendered today in 40 minutes after the upgrade.

I currently have 64GB of RAM, but I'm considering upgrading to max out at 128GB so I can render faster, especially since I'm prone to spelling errors in After Effects which has no grammar or spelling checker (that I know of). Haha

Anyway, I really suggest you get off "Windows" and move on to a really great unix-based OS like Linux or MacOS :slight_smile: If you want pretty windows and a slick UI, then go with the Mac. If you just want a raw server, then go with Linux. That's what I do, at least. Linux on the servers (without any GUI, terminal only) and Macs to run all the "eye candy" apps on the desktop (rending video with Adobe After Effects, Premier Pro, Camtasia, etc).

Cheers and Good Luck.

A full blown Linux kernel - WSL2 is part of the Windows 10 June update. So it does not require you to install cygwin or dual boot Ubuntu (or whatever Linux) to be able to effectively use UNIX.