C++ 中error: ‘exit’ was not declared in this scope 的解决方法

博客内容提及在代码中添加#include <cstdlib>,这是C++编程里引入标准库的操作,与信息技术中C++开发相关。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

添加

#include <cstdlib>

Arduino:1.8.19 (Windows 10), 开发板:"Arduino Uno" __3:19:9: error: 'DHTPIN' was not declared in this scope D:\开源硬件编程\综合2\__3\__3.ino:19:9: note: suggested alternative: 'DHT' D:\开源硬件编程\综合2\__3\__3.ino: In function 'void setup()': __3:33:11: error: 'FLAMPIN' was not declared in this scope D:\开源硬件编程\综合2\__3\__3.ino:33:11: note: suggested alternative: 'FLAME_PIN' __3:34:11: error: 'TRIGPIN' was not declared in this scope D:\开源硬件编程\综合2\__3\__3.ino:34:11: note: suggested alternative: 'TRIG_PIN' __3:35:11: error: 'ECHOPIN' was not declared in this scope D:\开源硬件编程\综合2\__3\__3.ino:35:11: note: suggested alternative: 'ECHO_PIN' __3:36:11: error: 'BUZZERPIN' was not declared in this scope D:\开源硬件编程\综合2\__3\__3.ino:36:11: note: suggested alternative: 'BUZZER_PIN' __3:37:11: error: 'LEDPIN' was not declared in this scope __3:38:11: error: 'BUTTONPIN' was not declared in this scope D:\开源硬件编程\综合2\__3\__3.ino:38:11: note: suggested alternative: 'BUTTON_PIN' D:\开源硬件编程\综合2\__3\__3.ino: In function 'void loop()': __3:54:26: error: 'MQ2PIN' was not declared in this scope D:\开源硬件编程\综合2\__3\__3.ino:54:26: note: suggested alternative: 'MQ2_PIN' __3:55:28: error: 'FLAMPIN' was not declared in this scope D:\开源硬件编程\综合2\__3\__3.ino:55:28: note: suggested alternative: 'FLAME_PIN' __3:78:19: error: 'BUTTONPIN' was not declared in this scope D:\开源硬件编程\综合2\__3\__3.ino:78:19: note: suggested alternative: 'BUTTON_PIN' __3:79:18: error: 'BUZZERPIN' was not declared in this scope D:\开源硬件编程\综合2\__3\__3.ino:79:18: note: suggested alternative: 'BUZZER_PIN' D:\开源硬件编程\综合2\__3\__3.ino: In function 'int getDistance()': __3:87:16: error: 'TRIGPIN' was not declared in this scope D:\开源硬件编程\综合2\__3\__3.ino:87:16: note: suggested alternative: 'TRIG_PIN' __3:93:27: error: 'ECHOPIN' was not declared in this scope D:\开源硬件编程\综合2\__3\__3.ino:93:27: note: suggested alternative: 'ECHO_PIN' D:\开源硬件编程\综合2\__3\__3.ino: In function 'void checkAlarm(float, int, bool)': __3:133:18: error: 'BUZZERPIN' was not declared in this scope D:\开源硬件编程\综合2\__3\__3.ino:133:18: note: suggested alternative: 'BUZZER_PIN' __3:134:18: error: 'LEDPIN' was not declared in this scope __3:139:18: error: 'BUZZERPIN' was not declared in this scope D:\开源硬件编程\综合2\__3\__3.ino:139:18: note: suggested alternative: 'BUZZER_PIN' __3:140:18: error: 'LEDPIN' was not declared in this scope exit status 1 'DHTPIN' was not declared in this scope 在文件 -> 首选项开启 “编译过程中显示详细输出”选项 这份报告会包含更多信息。 显示这样是怎么回事
最新发布
06-06
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值