gpt4 book ai didi

c++ - 在 Mac 上编译时未在范围内声明 nullptr

转载 作者:搜寻专家 更新时间:2023-10-31 00:57:13 24 4
gpt4 key购买 nike

我正在尝试使用“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 上编译?

最佳答案

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

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

关于c++ - 在 Mac 上编译时未在范围内声明 nullptr,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37822826/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com