Author Topic: C::B 12.11 - C++0x/C++11 compiler flag not working  (Read 6617 times)

Offline Morwenn

  • Multiple posting newcomer
  • *
  • Posts: 13
C::B 12.11 - C++0x/C++11 compiler flag not working
« on: February 10, 2013, 11:18:14 pm »
I recently switched from Code::Blocks 10.05 to 12.11 and have a problem I did not have before and I did not find anything on the forums about it: I have some projects that use C++11. Until then, I checked "Use C++0x" in compiler options, and naturally switched to "Use C++11", expecting it to work fine.

However, when I do this, G++ sometimes works fine and sometimes tells me "You need to enable C++11 to use this feature". Well, I tried many things to have it work. When I type "-std=c++11" in "Other Options" and then compile, it works fine once. Then option disappears (I bet it is automatically converted to "Compiler Flags") and if I try to compile again, G++ tells me again to enable C++11.

I had no problem with Code::Blocks 10.05 and I can get the work done properly with make alone or combined with cmake. So I'm wondering whether the compiler flag works properly.

EDIT: I'm using MinGW TDM-GCC 4.7.1 with Windows 7.
« Last Edit: February 10, 2013, 11:22:35 pm by Morwenn »

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: C::B 12.11 - C++0x/C++11 compiler flag not working
« Reply #1 on: February 12, 2013, 06:48:22 pm »
I remember seeing this kind of behavior before, but when I wanted to look into it I could no longer reproduce it. I would set a flag in 'Other Options', then it would disappear because it was, in theoretical theory, automagically converted into an existing flag. Thing is, it wasn't. It was recognized, removed, end of story.

Did you check if such flag exists in 'Compiler Flags'? Could you try setting it there and testing again (and then again)?

Offline Morwenn

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: C::B 12.11 - C++0x/C++11 compiler flag not working
« Reply #2 on: February 12, 2013, 08:35:10 pm »
The flag does exist in Compiler Flags. I used it and it worked well until the problem I described above came. That's why I resorted to typing it again by hand.

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: C::B 12.11 - C++0x/C++11 compiler flag not working
« Reply #3 on: February 13, 2013, 07:32:49 pm »
I can reproduce the issue here, but I don't have a development version at hand to check further.

Would you kindly fill in a bug report for this issue?

In the meanwhile, just set it in Compiler Flags and cross your fingers (even though that can make typing difficult).

Offline Morwenn

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: C::B 12.11 - C++0x/C++11 compiler flag not working
« Reply #4 on: February 18, 2013, 05:23:50 pm »
Sorry for the late answer.

It now somehow works for apparently no more reasons than it did not work before. Crossing my fingers may have been the right thing to do.

I'll try to submit a proper bug report once I have understood how that works^^