Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Arduino 1.0.6: How to change compiler flag?

I'm currently working on a project using Arduino 1.0.6 IDE and it does not seem to accept C++ 11 std::array. Is it possible to change the compiler flag to make this work?

like image 829
TheInvisibleFist Avatar asked Jan 20 '15 03:01

TheInvisibleFist


2 Answers

You can use #pragma inside the *.ino file so as not to have to create the local platforms file:

#pragma GCC diagnostic warning "-fpermissive"
#pragma GCC diagnostic ignored "-Wwrite-strings"

For other ones, see HERE.

like image 158
Guest Avatar answered Oct 27 '22 10:10

Guest


Using the IDE is very difficult to do that.

I would advise you to go full command line by using Sudar's great Arduino Makefile.

This way you'll be able to customise the compiler flags to your liking.

I've also created the Bare Arduino Project to help you get started. The documentation covers a lot points, from installing the latest avr-gcc toolchain to how to use the repository, compile and upload your code.

If you find something missing, please, feel free to fill an issue on Github so that I can fix it :)

Hope this helps! :)

like image 28
ladislas Avatar answered Oct 27 '22 12:10

ladislas