Author Topic: Cannot set -std=c++11  (Read 6433 times)

Offline freeze

  • Single posting newcomer
  • *
  • Posts: 6
Cannot set -std=c++11
« on: August 17, 2013, 08:45:28 pm »
I am using Code::Blocks 12.11 with the bundled CNU GCC compiler.
Under "Compiler settings>Other options" I would like to set -std=c++11.
This does not seem to be allowed, although -std=gnu++11 works fine.
My understanding is that -std=gnu++11 allows some nonstandard features, and I would rather avoid this.
Why does -std=c++11 not seem to be possible to set?
Is this a compiler issue, or a Code::Blocks IDE issue?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7598
    • My Best Post
Re: Cannot set -std=c++11
« Reply #1 on: August 17, 2013, 10:08:11 pm »
Try doing it under Project -> Build Options -> Compiler Flags
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline freeze

  • Single posting newcomer
  • *
  • Posts: 6
Re: Cannot set -std=c++11
« Reply #2 on: August 17, 2013, 11:18:36 pm »
Problem solved.
Thank you

Offline jellyhag

  • Single posting newcomer
  • *
  • Posts: 3
Re: Cannot set -std=c++11
« Reply #3 on: August 24, 2013, 11:31:04 pm »
As "std" is what GNU call a "long option", if they are coherent with themselves, they'll require TWO dashes before the option, as such : --std=c++11. (I don't know if that should fix the problem... the "-static" option DOES take only one dash, for example... but you might want to try it if you write a custom makefile...