User forums > Help

-std=c++11 not working (CB12.11)

(1/7) > >>

taimou:
Hi,
I seem to have a very strange problem with CB12.11
For some reason it won't compile with "-std=c++11" and as for the error it says that no such command can be found:

--- Code: ----------------- Build: default in Lethal_Sp4ce_irr (compiler: GNU GCC Compiler)---------------

mingw32-g++.exe   -std=c++11   -IC:\SDL-1.2.15\include\SDL -IC:\irrlicht-1.8\include -IC:\SDL_mixer-1.2.12  -c D:\git\lethal_sp4ce_master\build\Lethal_Sp4ce_irr\src\ls_audio.cpp -o .objs\src\ls_audio.o
cc1plus.exe: error: unrecognized command line option "-std=c++11"
Process terminated with status 1 (0 minutes, 0 seconds)
0 errors, 0 warnings (0 minutes, 0 seconds)
--- End code ---
Any ideas why it's not recognizing the option?

The project compiles fine with DevC++ so no idea what's the problem here.

- taimou

oBFusCATed:
This is the problem: http://wiki.codeblocks.org/index.php?title=FAQ-General#Q:_What_Code::Blocks_is_not.3F

taimou:

--- Quote from: oBFusCATed on March 22, 2013, 06:55:44 am ---This is the problem: http://wiki.codeblocks.org/index.php?title=FAQ-General#Q:_What_Code::Blocks_is_not.3F

--- End quote ---
Yes CB is not a compiler, however DevC++ also uses Mingw32-gcc as the compiler and as I said before the project compiles fine using DevC++ as the IDE.
So one could assume that CB is doing something wrong in directing the -std command to Mingw32-gcc.
Of course I can be completely wrong in this matter too, but then I'm baffled as to what could cause this problem.

//EDIT
Well I managed to fix the problem by changing the compiler CB uses to the one DevC++ uses.
Apparently there was some difference in the compiler versions then, or somesuch.

Jenna:
Which compiler have you used with C::B ?
TDM's MinGW shipped with C::B 12.11 (gcc 4.7.1) works fine with this option..

chaoticbob:
Hi,

I know this is and old topic, but I wanted to post this in case someone runs across the same problem.

I ran into the same problem as the OP. Turned out it was exactly what I had suspected. I have several different version of MingW installed on my system. Apparently C::B is very good at finding these different versions. The version that it defaulted me to was my GNUstep MingW using GCC 4.6.1. I just changed the Compiler's installation directory in Settings->Compiler to C:\Program Files (x86)\CodeBlocks\MinGW and it fixed the problem. Obviously, this applies to GNU GCC Compiler on the drop down.

Hope it helps and happy coding. ;D

Navigation

[0] Message Index

[#] Next page

Go to full version