mirror of
https://github.com/tzapu/WiFiManager.git
synced 2026-04-28 01:25:49 +03:00
[GH-ISSUE #654] ERROR when tried to complie 'DynamicJsonBuffer' was not declared in this scope #546
Labels
No labels
📶 WiFi
🕸️ HTTP
Branch
DEV Help Wanted
Discussion
Documentation
ESP32
Example
Good First Issue
Hotfix
In Progress
Incomplete
Needs Feeback
Priority
QA
Question
Task
Upstream/Dependancy
bug
duplicate
enhancement
invalid
pull-request
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/WiFiManager#546
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Ameengray on GitHub (Jul 12, 2018).
Original GitHub issue: https://github.com/tzapu/WiFiManager/issues/654
.I get the following error when i try to compile this code, can this be fixed its urgent, please lookinto it.
Arduino: 1.8.5 (Linux), Board: "Generic ESP8266 Module, 80 MHz, ck, 26 MHz, 40MHz, QIO, 512K (no SPIFFS), v2 Prebuilt (MSS=536), Disabled, None, 115200"
/root/Arduino/Blink2/Blink2.ino: In function 'void setup()':
Blink2:51: error: 'DynamicJsonBuffer' was not declared in this scope
DynamicJsonBuffer jsonBuffer;
^
/root/Arduino/Blink2/Blink2.ino:51:9: note: suggested alternative:
In file included from /root/Arduino/libraries/ArduinoJson/src/ArduinoJson/DynamicJsonDocument.hpp:10:0,
from /root/Arduino/libraries/ArduinoJson/src/ArduinoJson.hpp:9,
from /root/Arduino/libraries/ArduinoJson/src/ArduinoJson.h:9,
from /root/Arduino/Blink2/Blink2.ino:10:
/root/Arduino/libraries/ArduinoJson/src/ArduinoJson/Memory/DynamicJsonBuffer.hpp:159:5: note: 'ArduinoJson::Internals::DynamicJsonBuffer'
DynamicJsonBuffer;
^
Blink2:51: error: expected ';' before 'jsonBuffer'
DynamicJsonBuffer jsonBuffer;
^
Blink2:52: error: 'jsonBuffer' was not declared in this scope
JsonObject& json = jsonBuffer.parseObject(buf.get());
^
Blink2:53: error: 'class ArduinoJson::JsonObject' has no member named 'printTo'
json.printTo(Serial);
^
Blink2:130: error: 'DynamicJsonBuffer' was not declared in this scope
DynamicJsonBuffer jsonBuffer;
^
/root/Arduino/Blink2/Blink2.ino:130:5: note: suggested alternative:
In file included from /root/Arduino/libraries/ArduinoJson/src/ArduinoJson/DynamicJsonDocument.hpp:10:0,
from /root/Arduino/libraries/ArduinoJson/src/ArduinoJson.hpp:9,
from /root/Arduino/libraries/ArduinoJson/src/ArduinoJson.h:9,
from /root/Arduino/Blink2/Blink2.ino:10:
/root/Arduino/libraries/ArduinoJson/src/ArduinoJson/Memory/DynamicJsonBuffer.hpp:159:5: note: 'ArduinoJson::Internals::DynamicJsonBuffer'
DynamicJsonBuffer;
^
Blink2:130: error: expected ';' before 'jsonBuffer'
DynamicJsonBuffer jsonBuffer;
^
Blink2:131: error: 'jsonBuffer' was not declared in this scope
JsonObject& json = jsonBuffer.createObject();
^
Blink2:141: error: 'class ArduinoJson::JsonObject' has no member named 'printTo'
json.printTo(Serial);
^
Blink2:142: error: 'class ArduinoJson::JsonObject' has no member named 'printTo'
json.printTo(configFile);
^
Multiple libraries were found for "ArduinoJson.h"
Used: /root/Arduino/libraries/ArduinoJson
Not used: /root/Arduino/libraries/ArduinoJson-master
exit status 1
'DynamicJsonBuffer' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
@tablatronix commented on GitHub (Jul 12, 2018):
what does this have to do with wifimanager?
@Ameengray commented on GitHub (Jul 12, 2018):
This the given code https://github.com/tzapu/WiFiManager/tree/master/examples/AutoConnectWithFSParameters
When i want to be able to send custom parameters through the wifi manager, like mqtt username and password, when i refer to link provided in the documentation and compile the program, i get the above error, can you please why i am getting that error, i get the same error with other examples too.
@Ameengray commented on GitHub (Jul 12, 2018):
I got the answer, The problem was with the ArduinoJson, the version 6 is the beta stage, use version 5x to fix this issue.
@tablatronix commented on GitHub (Jul 12, 2018):
ok I saw blink.ino nothing about wm.
I guess the examples will have to be updated at some point it seems.
@per1234 commented on GitHub (Jul 12, 2018):
Some info:
@saubeo6600 commented on GitHub (Jul 18, 2018):
please fix this code for arduino ide 1.6.4 and aduinojson 5.13.2
@tablatronix commented on GitHub (Jul 18, 2018):
Please use proper code fences for code, are you asking someone to fix this for you , or does this contain the fix ?
@saubeo6600 commented on GitHub (Jul 18, 2018):
Arduino: 1.6.4 (Windows 7), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, 4M (1M SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
esp8266_final.ino: In function 'void setup()':
esp8266_final:51: error: 'DynamicJsonBuffer' was not declared in this scope
esp8266_final.ino:51:9: note: suggested alternative:
In file included from C:\Users\Administrator\Documents\Arduino\libraries\arduino_173318\src/ArduinoJson/DynamicJsonDocument.hpp:10:0,
from C:\Users\Administrator\Documents\Arduino\libraries\arduino_173318\src/ArduinoJson.hpp:9,
from C:\Users\Administrator\Documents\Arduino\libraries\arduino_173318\src/ArduinoJson.h:9,
from esp8266_final.ino:10:
C:\Users\Administrator\Documents\Arduino\libraries\arduino_173318\src/ArduinoJson/Memory/DynamicJsonBuffer.hpp:159:5: note: 'ArduinoJson::Internals::DynamicJsonBuffer'
DynamicJsonBuffer;
^
esp8266_final:51: error: expected ';' before 'jsonBuffer'
esp8266_final:52: error: 'jsonBuffer' was not declared in this scope
esp8266_final:53: error: 'class ArduinoJson::JsonObject' has no member named 'printTo'
esp8266_final:54: error: 'class ArduinoJson::JsonObject' has no member named 'success'
esp8266_final:130: error: 'DynamicJsonBuffer' was not declared in this scope
esp8266_final.ino:130:5: note: suggested alternative:
In file included from C:\Users\Administrator\Documents\Arduino\libraries\arduino_173318\src/ArduinoJson/DynamicJsonDocument.hpp:10:0,
from C:\Users\Administrator\Documents\Arduino\libraries\arduino_173318\src/ArduinoJson.hpp:9,
from C:\Users\Administrator\Documents\Arduino\libraries\arduino_173318\src/ArduinoJson.h:9,
from esp8266_final.ino:10:
C:\Users\Administrator\Documents\Arduino\libraries\arduino_173318\src/ArduinoJson/Memory/DynamicJsonBuffer.hpp:159:5: note: 'ArduinoJson::Internals::DynamicJsonBuffer'
DynamicJsonBuffer;
^
esp8266_final:130: error: expected ';' before 'jsonBuffer'
esp8266_final:131: error: 'jsonBuffer' was not declared in this scope
esp8266_final:141: error: 'class ArduinoJson::JsonObject' has no member named 'printTo'
esp8266_final:142: error: 'class ArduinoJson::JsonObject' has no member named 'printTo'
Multiple libraries were found for "WiFiManager.h"
Used: C:\Users\Administrator\Documents\Arduino\libraries\WiFiManager-master
Not used: C:\Users\Administrator\Documents\Arduino\libraries\WhareHauoraWiFiManager
Multiple libraries were found for "ArduinoJson.h"
Used: C:\Users\Administrator\Documents\Arduino\libraries\arduino_173318
Not used: C:\Users\Administrator\Documents\Arduino\libraries\ArduinoJson
'DynamicJsonBuffer' was not declared in this scope
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
@tablatronix commented on GitHub (Jul 18, 2018):
This is for issues and bugs, do not post support questions here thanks
@tablatronix commented on GitHub (Jul 19, 2018):
Ideally we would detect which version and handle, although this is just an example and not part of the library
@brentru commented on GitHub (Aug 17, 2018):
@tablatronix Heya - I'm planning to use this library for the Adafruit IO Arduino Library (https://github.com/adafruit/Adafruit_IO_Arduino) and would be happy to work on this issue. Could you assign it to me?
@tablatronix commented on GitHub (Aug 17, 2018):
Not atm, but you can PR it against development branch
@brentru commented on GitHub (Aug 17, 2018):
Thanks - will do!
@tablatronix commented on GitHub (Aug 17, 2018):
Maybe add support in the example in question for both versioons somehow?
Is it still in beta? Maybe make a branch for next version of arduinojson 6 or whatever
@brentru commented on GitHub (Aug 17, 2018):
The ArduinoJSON library is still in beta 6.x. I'm going to source the version in the example (if they expose a version) and handle the error.
@ghost commented on GitHub (Jan 15, 2019):
Guys the code is still not compiling for me even after I downgrade the version on arduinojson library. Can anyone help me out? I tried version 5.12.1, 5.12.2 and even 5.13
@Jewel852 commented on GitHub (Sep 8, 2019):
Arduino: 1.8.9 (Windows 10), Board: "NodeMCU 1.0 (ESP-12E Module), 80 MHz, Flash, Disabled, All SSL ciphers (most compatible), 4M (no SPIFFS), v2 Lower Memory, Disabled, None, Only Sketch, 115200"
C:\Users\srjew\Documents\Arduino\libraries\arduino-youtube-api-master\src\YoutubeApi.cpp:95:11: error: DynamicJsonBuffer is a class from ArduinoJson 5. Please see arduinojson.org/upgrade to learn how to upgrade your program to ArduinoJson version 6
DynamicJsonBuffer jsonBuffer;
C:\Users\srjew\Documents\Arduino\libraries\arduino-youtube-api-master\src\YoutubeApi.cpp: In member function 'bool YoutubeApi::getChannelStatistics(String)':
C:\Users\srjew\Documents\Arduino\libraries\arduino-youtube-api-master\src\YoutubeApi.cpp:95:20: error: 'jsonBuffer' was not declared in this scope
DynamicJsonBuffer jsonBuffer;
C:\Users\srjew\Documents\Arduino\libraries\arduino-youtube-api-master\src\YoutubeApi.cpp:97:10: error: 'ArduinoJson::JsonObject' has no member named 'success'
if(root.success()) {
exit status 1
Error compiling for board NodeMCU 1.0 (ESP-12E Module).
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
@tablatronix commented on GitHub (Sep 8, 2019):
I have to fix this, I will try to do it this week, I pushed v0.15-beta but it is not showing in arduino library manager still, no idea wtf is the deal with arduino
@tihoangyeudau commented on GitHub (Sep 8, 2019):
you need to downgrade arduinoJson to v5.11.3
@per1234 commented on GitHub (Sep 8, 2019):
@tablatronix I don't know for sure because I have no access to the library indexer script, but I think the problem must be the
versionvalue in library.properties for that release: 0.15-beta. Although the indexer does support non-semver versions like 0.15, I don't know that it supports the prerelease syntax on top of the non-semver version.What is certain is that any semver-compliant version will be accepted. So my recommendation is to just start using semver-compliant versioning:
https://semver.org/
@Spackstor commented on GitHub (Jan 21, 2020):
Try adding a size to DynamicJsonDocument doc(1024); worked for me.
Go here for a little guidance.
@Ruandv commented on GitHub (Jan 27, 2020):
@tablatronix this can be closed because of pull request #993