Hello everyone, I will create a project about notification via telegram bot. But I can't upload the sketch. Returns an error message.
And other sketches are loaded besides this one .
Telegram sketches:
In file included from C:\Users\ACER\Documents\Arduino\libraries\Universal-Arduino-Telegram-Bot-master\src/UniversalTelegramBot.h:31,
from C:\Users\ACER\AppData\Local\Temp\arduino_modified_sketch_670407\sketch_nov20a.ino:2:
C:\Users\ACER\Documents\Arduino\libraries\Universal-Arduino-Telegram-Bot-master\src/TelegramCertificate.h:9:12: error: redefinition of 'const char TELEGRAM_CERTIFICATE_ROOT []'
9 | const char TELEGRAM_CERTIFICATE_ROOT[] = R"=EOF=(
| ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\ACER\AppData\Local\Temp\arduino_modified_sketch_670407\sketch_nov20a.ino:1:
C:\Users\ACER\Documents\Arduino\libraries\Universal-Arduino-Telegram-Bot-master\src/TelegramCertificate.h:9:12: note: 'const char TELEGRAM_CERTIFICATE_ROOT [1369]' previously defined here
9 | const char TELEGRAM_CERTIFICATE_ROOT[] = R"=EOF=(
| ^~~~~~~~~~~~~~~~~~~~~~~~~
exit status 1
Compilation error for the NodeMCU 1.0 (ESP-12E Module).
The TelegramCertificate.h file is included by the library, and unfortunately they neglected to put header guards in that file to prevent it being included more than once.
In file included from C:\Users\ACER\Documents\Arduino\libraries\Universal-Arduino-Telegram-Bot-master\src/UniversalTelegramBot.h:31,
from C:\Users\ACER\Desktop\wifi\wifi.ino:2:
C:\Users\ACER\Documents\Arduino\libraries\Universal-Arduino-Telegram-Bot-master\src/TelegramCertificate.h:9:12: error: redefinition of 'const char TELEGRAM_CERTIFICATE_ROOT []'
9 | const char TELEGRAM_CERTIFICATE_ROOT[] = R"=EOF=(
| ^~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\ACER\Desktop\wifi\wifi.ino:1:
C:\Users\ACER\Documents\Arduino\libraries\Universal-Arduino-Telegram-Bot-master\src/TelegramCertificate.h:9:12: note: 'const char TELEGRAM_CERTIFICATE_ROOT [1369]' previously defined here
9 | const char TELEGRAM_CERTIFICATE_ROOT[] = R"=EOF=(
| ^~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\ACER\Desktop\wifi\wifi.ino: In function 'void setup()':
wifi:24:27: error: 'cert' was not declared in this scope; did you mean 'cbrt'?
24 | client.setTrustAnchors(&cert); // Add root certificate for api.telegram.org
| ^~~~
| cbrt
exit status 1
'cert' was not declared in this scope; did you mean 'cbrt'?
sketch_nov21a:17:15: error: 'TELEGRAM_CERTIFICATE_ROOT' was not declared in this scope
17 | X509List cert(TELEGRAM_CERTIFICATE_ROOT);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
Several libraries found for "UniversalTelegramBot.h"
Is used: C:\Users\ACER\Documents\Arduino\libraries\UniversalTelegramBot
Not used: C:\Users\ACER\Documents\Arduino\libraries\Universal-Arduino-Telegram-Bot-master
exit status 1
'TELEGRAM_CERTIFICATE_ROOT' was not declared in this scope
Where did you get the UniversalTelegramBot library? TELEGRAM_CERTIFICATE_ROOT is declared in that library, in the file TelegramCertificate.h, so it should not give an error. Did you modify any of the library files???