9

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.

ozgur
  • 479
  • 5
  • 12
  • 2
    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`? – PeterJ Oct 24 '15 at 10:31
  • 1
    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. – Grebu Oct 24 '15 at 13:32

1 Answers1

9

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

PeterJ
  • 17,131
  • 37
  • 56
  • 91