User forums > Using Code::Blocks

[Solved]c++ 11 standard argument is only added using the additional option

(1/3) > >>

Jewest:
Hello,

For my development I use:
Debian 3.16.7-ckt4-3 and code blocks 13.12.

Because I use shared_ptr in the project I need the c++11 flag to be added to the compile line.
What I found is that in the build options op the GCC compiler work different then expected.
For the general project I use the -std=c++11 option, but the compiler output there is no -std=c++11.
When I select the -std=c++11 in the release target it does add the -std=c++11.

strangely if I add the "-std=c++11" test to the other options tab twice the command added to the compiler line.
In this case I only checked the -std=c++11option in the main settings of the project.

Also when I was playing around with the settings sometimes it worked, then I restarted C::B and it did not work again.

please fix this as it has caused me a day to figure out that the IDE was my problem and not my code.
Thank you in advance.

Best regards,

Jewest

oBFusCATed:
Hm, I'm not really sure what is the problem but is sounds like you have inappropriate value of the policy setting for you targets.
What is the value of you policy for the targets that don't work?

Jewest:
In the Main project settings I specify that I want to use the C++ 11 standard.

I expect that in the compiler output I get  -std=c++11.
This  does not happen.
1]. When I select the option in the build target is does work.
2].  if I add the "-std=c++11" to the other options tab, twice the command added to the compiler line

So it looks like an internal option check is not performed correctly.

Where can I find this information: What is the value of you policy for the targets that don't work?

oBFusCATed:
Project -> Build options ->  your target -> Compiler settings -> Policy (just below the tab).

Jewest:
Sorry I missed it.  ;)
Settings is append target options to project options.

See the screenshots this does not work.
I need to enable the C++11 in the append to make it work.
please let me know if you need more information.

[attachment deleted by admin]

Navigation

[0] Message Index

[#] Next page

Go to full version