Author Topic: -std=c++11 is passed even when compiling c files (gives error with clang)  (Read 8913 times)

Offline Dmytry

  • Single posting newcomer
  • *
  • Posts: 8
    • My webpage, Volumetrics for MojoWorld, The Galaxy, etc.
I was trying to compile a project that uses c and c++11 files, with clang as the compiler, and I'm getting

error: invalid argument '-std=c++11' not allowed with 'C/ObjC'

Is there any easy way not to set this option for the c files?

edit: found a (less than optimal) solution: un-setting the c++11 option and editing the toolchain executables and adding -std=c++11 there just for the c++ compiler .
« Last Edit: December 03, 2015, 08:11:56 am by Dmytry »

Offline scarphin

  • Lives here!
  • ****
  • Posts: 640
Re: -std=c++11 is passed even when compiling c files (gives error with clang)
« Reply #1 on: December 03, 2015, 11:03:37 am »
I think it's not a bug but an incapability to set different settings for C and C++ sources. They should be separated imo.

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7252
Re: -std=c++11 is passed even when compiling c files (gives error with clang)
« Reply #2 on: December 03, 2015, 05:38:23 pm »
You should be able to add -std=c++11 to the c++ only flags.
Just right click into the compiler options ...