如何用C ++ 11到Arduino编程? [英] How to use c++11 to program the Arduino?

查看:1331
本文介绍了如何用C ++ 11到Arduino编程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 C ++编程11 Arduino的时候?我想无论是使用Arduino的IDE或其他环境被罚款。我最感兴趣的核心语言的改善,而不是要求标准库的变化的东西。

How can I use c++11 when programming the Arduino? I would be fine using either the Arduino IDE or another environment. I am most interested in the core language improvements, not things that require standard library changes.

推荐答案

在Arduino的IDE 的 latests版本,其实这是很容易改变的标志<​​/ STRONG>工具链中的任何元素,,包括汇编器,编译器,连接器或归档。

On the latests versions of the Arduino IDE, in fact it is very easy to change the flags for any element of the toolchain, including the assembler, compiler, linker or archiver.

测试Arduino上IDE版本1.5.7(2014年7月发布)

Tested on the Arduino IDE version 1.5.7 (released on July 2014),


  1. 找到在 platform.txt 文件,

    • AVR架构=> {安装路径} \\五金\\ Arduino的\\ AVR \\ platform.txt

    • SAM结构=> {安装路径} \\五金\\ Arduino的\\ SAM \\ platform.txt


  • compiler.c.flags更改默认的编译标志C ++文件。

  • compiler.cpp.flags更改默认的编译标志C ++文件。

例如,

要启用C ++ 11(C ++ 0x中),在Arduino的IDE版本1.5.7和1.5.8的测试,您将只需添加标志的支持-std = GNU + +11在起始compiler.cpp.flags该行的末尾=

To enable support for C++11 (C++0x), tested on Arduino IDE versions 1.5.7 and 1.5.8, you will simply add the flag "-std=gnu++11" at the end of the line starting with compiler.cpp.flags=".

据预计,C ++ 11是默认的在不久的将来的Arduino上IDE启用。然而,由于1.5.8版本(2014年10月)仍是并非如此。

It is expected that C++11 is enabled by default in the near future on the Arduino IDE. However, as of version 1.5.8 (Oct 2014) it is still not the case.

这篇关于如何用C ++ 11到Arduino编程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆