【问题标题】:nullptr not declared in scope when compiling on mac在 mac 上编译时未在范围内声明 nullptr
【发布时间】:2016-10-15 19:47:00
【问题描述】:

我正在尝试使用“Yet Another PCInt Library”在我的 Arduino mega 2560 上启用引脚更改中断。在 Arduino IDE 中,代码在 windows 上编译良好,但在 mac 上失败。它给出了一个错误代码说明:

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

我怎样才能让它在 arduino IDE 中的 OS X 上编译?

【问题讨论】:

    标签: c++ arduino interrupt nullptr


    【解决方案1】:

    nullptr 被引入到 C++11 标准中,在任何早期的标准中都不存在。
    我最好的猜测是您的 arduino IDE 未配置为针对 C++11 标准进行编译。

    您可能希望确保avr-g++ 被赋予--std=c++11 或更高的标志。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-02-27
      • 1970-01-01
      • 1970-01-01
      • 2021-05-13
      • 2021-11-25
      • 1970-01-01
      相关资源
      最近更新 更多