求助编译错误-Arduino中文社区 - Powered by Discuz!

Arduino中文社区

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 1084|回复: 2

[未解决] 求助编译错误

[复制链接]
发表于 2021-4-12 12:38 | 显示全部楼层 |阅读模式
谁能帮我看看这个主要是错在那里了···
是文件放在桌面的原因?
Arduino:1.8.12 (Windows 10), 开发板:"Arduino Uno"

time:40:21: error: variable 'ntpServer' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

const PROGMEM char *ntpServer = "ntp.aliyun.com";

                     ^~~~~~~~~

In file included from C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:96:0,

                 from C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/BlinkerSerialESPMQTT.h:5,

                 from C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker.h:46,

                 from C:\Users\Administrator\Desktop\time\time.ino:46:

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerProtocol.h: In member function 'char* BlinkerProtocol::dataParse()':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerProtocol.h:257:86: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

         char* dataParse()       { if (canParse) return conn->lastRead(); else return ""; }

                                                                                      ^~

In file included from C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/BlinkerSerialESPMQTT.h:5:0,

                 from C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker.h:46,

                 from C:\Users\Administrator\Desktop\time\time.ino:46:

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h: At global scope:

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:850:97: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

         BlinkerWidgets_string _BUILTIN_SWITCH = BlinkerWidgets_string(BLINKER_CMD_BUILTIN_SWITCH);

                                                                                                 ^

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_str(uint8_t)':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:8077:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^~

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_joy(uint8_t)':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:8084:21: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

         else return "";

                     ^~

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_rgb(uint8_t)':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:8091:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^~

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_int(uint8_t)':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:8097:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^~

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h: In member function 'char* BlinkerApi::widgetName_tab(uint8_t)':

C:\Users\Administrator\Documents\Arduino\libraries\Blinker\src/Blinker/BlinkerApi.h:8103:17: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]

     else return "";

                 ^~

C:\Users\Administrator\Desktop\time\time.ino: At global scope:

time:258:1: error: 'ICACHE_RAM_ATTRvoid' does not name a type

ICACHE_RAM_ATTR void attachInterrupt_fun_5() {

^~~~~~~~~~~~~~~~~~~

time:488:1: error: 'ICACHE_RAM_ATTRvoid' does not name a type

ICACHE_RAM_ATTR void attachInterrupt_fun_4() {

^~~~~~~~~~~~~~~~~~~

time:258:1: error: 'ICACHE_RAM_ATTR' does not name a type

ICACHE_RAM_ATTR void attachInterrupt_fun_5() {

^~~~~~~~~~~~~~~

C:\Users\Administrator\Desktop\time\time.ino: In function 'void getntime()':

time:310:7: error: 'WiFi' was not declared in this scope

   if (WiFi.status()) {

       ^~~~

C:\Users\Administrator\Desktop\time\time.ino: At global scope:

time:488:1: error: 'ICACHE_RAM_ATTR' does not name a type

ICACHE_RAM_ATTR void attachInterrupt_fun_4() {

^~~~~~~~~~~~~~~

C:\Users\Administrator\Desktop\time\time.ino: In function 'void loop()':

time:577:44: error: 'attachInterrupt_fun_5' was not declared in this scope

   attachInterrupt(digitalPinToInterrupt(5),attachInterrupt_fun_5,RISING);

                                            ^~~~~~~~~~~~~~~~~~~~~

C:\Users\Administrator\Desktop\time\time.ino:577:44: note: suggested alternative: 'attachInterrupt'

   attachInterrupt(digitalPinToInterrupt(5),attachInterrupt_fun_5,RISING);

                                            ^~~~~~~~~~~~~~~~~~~~~

                                            attachInterrupt

time:584:44: error: 'attachInterrupt_fun_4' was not declared in this scope

   attachInterrupt(digitalPinToInterrupt(4),attachInterrupt_fun_4,RISING);

                                            ^~~~~~~~~~~~~~~~~~~~~

C:\Users\Administrator\Desktop\time\time.ino:584:44: note: suggested alternative: 'attachInterrupt'

   attachInterrupt(digitalPinToInterrupt(4),attachInterrupt_fun_4,RISING);

                                            ^~~~~~~~~~~~~~~~~~~~~

                                            attachInterrupt

exit status 1
variable 'ntpServer' must be const in order to be put into read-only section by means of '__attribute__((progmem))'

在文件 -> 首选项开启
“编译过程中显示详细输出”选项
这份报告会包含更多信息。


QQ截图20210412123913.png
 楼主| 发表于 2021-4-12 12:40 | 显示全部楼层
使用 1.7.0  版本的库 Adafruit_NeoPixel 在文件夹: C:\Users\Administrator\Documents\Arduino\libraries\Adafruit_NeoPixel
使用 1.6  版本的库 Time 在文件夹: C:\Users\Administrator\Documents\Arduino\libraries\Time
使用 3.0.2-beta  版本的库 NtpClientLib 在文件夹: C:\Users\Administrator\Documents\Arduino\libraries\NtpClientLib
使用 2.0.0  版本的库 Ethernet 在文件夹: E:\arduino-1.8.12\libraries\Ethernet
使用库 SimpleTimer 在文件夹: C:\Users\Administrator\Documents\Arduino\libraries\SimpleTimer (legacy)
使用 1.5.0  版本的库 OneButton 在文件夹: C:\Users\Administrator\Documents\Arduino\libraries\OneButton
使用 0.3.6  版本的库 Blinker 在文件夹: C:\Users\Administrator\Documents\Arduino\libraries\Blinker
使用 1.0  版本的库 SoftwareSerial 在文件夹: E:\arduino-1.8.12\hardware\arduino\avr\libraries\SoftwareSerial
使用 1.0  版本的库 SPI 在文件夹: E:\arduino-1.8.12\hardware\arduino\avr\libraries\SPI
exit status 1
variable 'ntpServer' must be const in order to be put into read-only section by means of '__attribute__((progmem))'
发表于 2021-4-12 12:53 | 显示全部楼层
去掉PROGMEM 看看
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|Archiver|手机版|Arduino中文社区

GMT+8, 2024-11-29 08:46 , Processed in 0.105038 second(s), 18 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表