8
\$\begingroup\$

I am currently using Atmel Studio 7 and I need to enable c++11 support for it. I couldn't find any documentation about this topic. Moreover, I am not even sure it has c++11 support, yet.

\$\endgroup\$
  • 2
    \$\begingroup\$ Have never tried it but does it work if you go into the AVR/GNU C Compiler / Miscellaneous options for the project and change -std=gnu99 to -std=gnu++11? \$\endgroup\$ – PeterJ Oct 24 '15 at 10:31
  • 1
    \$\begingroup\$ An alternative I am using is setting the compiler flag -std=c++11. You can write this or PeterJs solution in the "Other flags field of Miscelleaneous of AVR/GNU C++ Compiler. \$\endgroup\$ – Grebu Oct 24 '15 at 13:32
7
\$\begingroup\$

I just started a new C++ project under Atmel Studio 7 and with the default options the following code failed with a nullptr not declared error:

char *c;
if (c == nullptr)
    ;

Then I went into the Toolchain options under the project properties and added the -std=c++11 flag as suggested by Grebu under the "other flags" which seemed like the best place for it and it compiled fine:

Atmel Studio with C++ 11 enabled

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.