启用Arduino的环境异常 [英] Enable exceptions in the Arduino environment
问题描述
根据一个<一href=\"http://stackoverflow.com/questions/461836/arduino-c-$c$c-can-you-use-virtual-functions-and-exceptions#answer-464097\">answer一个问题了解 Arduino的环境是否支持异常,这是理论上可以在一个Arduino板运行的例外的二进制文件。
According to an answer to a question about whether the arduino environment supports exceptions, it is theoretically possible to run "exceptional" binaries on an Arduino board.
我将如何改变我的Arduino IDE允许这样做?具体来说,我怎么prevent了IDE包括 -fno-例外
标志调用编译器时?
How would I alter my Arduino IDE to allow this? Specifically, how do I prevent the IDE from including the -fno-exceptions
flag when invoking the compiler?
推荐答案
Arduino的IDE通 -fno-例外
它使用的编译器( AVR-GCC
)。它这样做是因为编译器的文档指定它是必需的(见 HTTP ://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_cplusplus )
The Arduino IDE passes -fno-exceptions
to the compiler it uses (avr-gcc
). It does this because the compiler's documentation specifies that it is required (see http://www.nongnu.org/avr-libc/user-manual/FAQ.html#faq_cplusplus).
由于这个参数是必须的(无论正确与否)编译器的功能是否正常的Arduino的IDE不提供一种方法来改变这种状况。
Since this parameter is required (rightly or wrongly) for correct functioning of the compiler the Arduino IDE does not provide a way to change this.
不过,如果你想尝试删除这个参数来看看它有什么作用,你需要编辑的Arduino源$ C $ C(目前589行中的https://github.com/arduino/Arduino/blob/master/app/src/processing/app/debug/Compiler.java)和自己重建IDE。
Nevertheless, if you want to try removing this parameter to see what effect it has you'll need to edit the Arduino source code (currently line 589 in https://github.com/arduino/Arduino/blob/master/app/src/processing/app/debug/Compiler.java) and rebuild the IDE yourself.
这篇关于启用Arduino的环境异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!