User forums > Using Code::Blocks
-std=c++11 is passed even when compiling c files (gives error with clang)
(1/1)
Dmytry:
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 .
scarphin:
I think it's not a bug but an incapability to set different settings for C and C++ sources. They should be separated imo.
Jenna:
You should be able to add -std=c++11 to the c++ only flags.
Just right click into the compiler options ...
Navigation
[0] Message Index
Go to full version