问题
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