在Mac上进行编译时,未在范围内声明nullptr [英] nullptr not declared in scope when compiling on mac

查看:123
本文介绍了在Mac上进行编译时,未在范围内声明nullptr的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用"又一个PCInt库"以在我的Arduino mega 2560上启用针脚更改中断.在Arduino IDE中,该代码在Windows上可以正常编译,但在mac上失败.它给出了一个错误代码,说明:

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);
                      ^

如何在arduino IDE中将其编译到OS X上?

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

推荐答案

nullptr 已引入C ++ 11标准,并且在任何较早的标准中都不存在.
我最好的猜测是您的arduino IDE未配置为可根据C ++ 11标准进行编译.

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.

您可能要确保为 avr-g ++ 赋予标志-std = c ++ 11 或更高.

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

这篇关于在Mac上进行编译时,未在范围内声明nullptr的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆