nullptr not declared in scope when compiling on mac

懵懂的女人 提交于 2021-02-10 07:03:55

问题


I'm trying to use the "Yet Another PCInt Library" for enabling pin change interrupts on my Arduino mega 2560. In the Arduino IDE, the code compiles fine on windows, but fails on a mac. It gives an error code stating:

 nullptr not declared in this scope
 attachInterrupt(pin, (callback)func, nullptr, mode, trigger_now);
                      ^

How can I get this to compile on OS X in the arduino IDE?


回答1:


nullptr was introduced into the C++11 standard, and it does not exist in any earlier standards.
My best guess is that your arduino IDE is not configured to compile against the C++11 standard.

You may want to ensure that avr-g++ is given the flag --std=c++11 or higher.



来源:https://stackoverflow.com/questions/37822826/nullptr-not-declared-in-scope-when-compiling-on-mac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!