Прошу помощи, так как с утра уже голову себе сломал
Суть проблемы: любой скетч, в котором будет подключена библиотека <TelegramBot.h> отказывается компилироваться и выдаёт ошибку:
СпойлерПоказать
Arduino: 1.8.11 (Windows 7), Плата:"NodeMCU 0.9 (ESP-12 Module), 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), 4MB (FS:2MB OTA:~1019KB), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:39:11: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:87:11: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:102:11: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp: In member function 'message TelegramBot::getUpdates()':
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:39:20: error: expected primary-expression before '<' token
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:39:37: error: 'jsonBuffer' was not declared in this scope
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:44:12: error: 'ArduinoJson::JsonObject' has no member named 'success'
if(root.success()){
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp: In member function 'String TelegramBot::sendMessage(String, String)':
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:87:19: error: expected primary-expression before '<' token
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:87:36: error: 'jsonBuffer' was not declared in this scope
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:93:8: error: 'ArduinoJson::JsonObject' has no member named 'printTo'
buff.printTo(msg);
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp: In member function 'String TelegramBot::sendMessage(String, String, TelegramKeyboard&, bool, bool)':
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:102:19: error: expected primary-expression before '<' token
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:102:36: error: 'jsonBuffer' was not declared in this scope
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:107:68: error: invalid initialization of non-const reference of type 'ArduinoJson::JsonObject& {aka ArduinoJson6141_0000010::ObjectRef&}' from an rvalue of type 'ArduinoJson6141_0000010::ObjectRef'
JsonObject& reply_markup = buff.createNestedObject("reply_markup");
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:108:66: error: invalid initialization of non-const reference of type 'ArduinoJson::JsonArray& {aka ArduinoJson6141_0000010::ArrayRef&}' from an rvalue of type 'ArduinoJson6141_0000010::ArrayRef'
JsonArray& keyboard = reply_markup.createNestedArray("keyboard");
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:111:48: error: invalid initialization of non-const reference of type 'ArduinoJson::JsonArray& {aka ArduinoJson6141_0000010::ArrayRef&}' from an rvalue of type 'ArduinoJson6141_0000010::ArrayRef'
JsonArray& row = keyboard.createNestedArray();
^
In file included from D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\packages\esp8266\hardware\esp8266\2.6.3\cores\esp8266/Arduino.h:29:0,
from D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.h:10,
from D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:8:
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:117:20: error: expected primary-expression before 'bool'
reply_markup.set<bool>("one_time_keyboard", one_time_keyboard);
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:117:20: error: expected ';' before 'bool'
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:118:20: error: expected primary-expression before 'bool'
reply_markup.set<bool>("resize_keyboard", resize_keyboard);
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:118:20: error: expected ';' before 'bool'
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:119:20: error: expected primary-expression before 'bool'
reply_markup.set<bool>("selective", false);
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:119:20: error: expected ';' before 'bool'
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:122:8: error: 'ArduinoJson::JsonObject' has no member named 'printTo'
buff.printTo(msg);
^
Несколько библиотек найдено для "ArduinoJson.h"
Используется: D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\ArduinoJson
Не используется: D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\libraries\ArduinoJson
exit status 1
Ошибка компиляции для платы NodeMCU 0.9 (ESP-12 Module).
Этот отчёт будет иметь больше информации с
включенной опцией Файл -> Настройки ->
"Показать подробный вывод во время компиляции"
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:39:11: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:87:11: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:102:11: error: StaticJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp: In member function 'message TelegramBot::getUpdates()':
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:39:20: error: expected primary-expression before '<' token
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:39:37: error: 'jsonBuffer' was not declared in this scope
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:44:12: error: 'ArduinoJson::JsonObject' has no member named 'success'
if(root.success()){
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp: In member function 'String TelegramBot::sendMessage(String, String)':
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:87:19: error: expected primary-expression before '<' token
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:87:36: error: 'jsonBuffer' was not declared in this scope
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:93:8: error: 'ArduinoJson::JsonObject' has no member named 'printTo'
buff.printTo(msg);
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp: In member function 'String TelegramBot::sendMessage(String, String, TelegramKeyboard&, bool, bool)':
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:102:19: error: expected primary-expression before '<' token
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:102:36: error: 'jsonBuffer' was not declared in this scope
StaticJsonBuffer<JSON_BUFF_SIZE> jsonBuffer;
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:107:68: error: invalid initialization of non-const reference of type 'ArduinoJson::JsonObject& {aka ArduinoJson6141_0000010::ObjectRef&}' from an rvalue of type 'ArduinoJson6141_0000010::ObjectRef'
JsonObject& reply_markup = buff.createNestedObject("reply_markup");
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:108:66: error: invalid initialization of non-const reference of type 'ArduinoJson::JsonArray& {aka ArduinoJson6141_0000010::ArrayRef&}' from an rvalue of type 'ArduinoJson6141_0000010::ArrayRef'
JsonArray& keyboard = reply_markup.createNestedArray("keyboard");
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:111:48: error: invalid initialization of non-const reference of type 'ArduinoJson::JsonArray& {aka ArduinoJson6141_0000010::ArrayRef&}' from an rvalue of type 'ArduinoJson6141_0000010::ArrayRef'
JsonArray& row = keyboard.createNestedArray();
^
In file included from D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\packages\esp8266\hardware\esp8266\2.6.3\cores\esp8266/Arduino.h:29:0,
from D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.h:10,
from D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:8:
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:117:20: error: expected primary-expression before 'bool'
reply_markup.set<bool>("one_time_keyboard", one_time_keyboard);
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:117:20: error: expected ';' before 'bool'
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:118:20: error: expected primary-expression before 'bool'
reply_markup.set<bool>("resize_keyboard", resize_keyboard);
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:118:20: error: expected ';' before 'bool'
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:119:20: error: expected primary-expression before 'bool'
reply_markup.set<bool>("selective", false);
^
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:119:20: error: expected ';' before 'bool'
D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\TelegramBot\src\TelegramBot.cpp:122:8: error: 'ArduinoJson::JsonObject' has no member named 'printTo'
buff.printTo(msg);
^
Несколько библиотек найдено для "ArduinoJson.h"
Используется: D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\portable\sketchbook\libraries\ArduinoJson
Не используется: D:\FLProg\PortableFLProg_6-3-1_Win32\ideV5\libraries\ArduinoJson
exit status 1
Ошибка компиляции для платы NodeMCU 0.9 (ESP-12 Module).
Этот отчёт будет иметь больше информации с
включенной опцией Файл -> Настройки ->
"Показать подробный вывод во время компиляции"
Привожу код в IDE:
СпойлерПоказать
#include <TelegramBot.h>
#include <TelegramKeyboard.h>
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
#include <TelegramKeyboard.h>
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
Спасибо!