Platformio compile error: ArduinoJson6100_100::DynamicJsonDocument has no member named 'nestingLimit'

Platformio compile error: ArduinoJson6100_100::DynamicJsonDocument has no member named 'nestingLimit'

我是 c++ 新手,正在尝试在 Platformio 中编译简单的 arduino 项目。

platformio.ini 文件:

    [platformio]
src_dir = .
lib_extra_dirs = .piolibdeps/, ../../

[env:nodemcuv2]
platform = espressif8266
board = nodemcuv2
framework = arduino
lib_deps = 
#    PubSubClient
    painlessMesh

main.ino 文件:

#include <Arduino.h>
#include <painlessMesh.h>
void setup()
{
}

void loop()
{
}

应该很简单,但我遇到了下一个错误:

'ArduinoJson6100_100::DynamicJsonDocument' has no member named 'nestingLimit'

完整的编译器堆栈:

Executing task in folder test4: platformio run <

正在处理nodemcuv2(平台:espressif8266;板卡:nodemcuv2; 框架:arduino) ---------------------------------------------- ---------------------------------------------- -------- 可以通过 -v, --verbose 选项配置启用详细模式: https://docs.platformio.org/page/boards/espressif8266/nodemcuv2.html 平台:Espressif 8266 > NodeMCU 1.0(ESP-12E 模块)硬件: ESP8266 80MHz 80KB RAM(4MB 闪存)转换 main.ino 库 依赖查找器 -> LDF 模式: FINDER(chain) COMPATIBILITY(soft) 收集了35个兼容库 正在扫描依赖关系...依赖关系图 |-- 1.3.0 |
|-- 6.10.0 | |-- 3.0.2 | |-- 1.2.0 | | |-- 1.0 | |-- 1.0 编译 .pioenvs/nodemcuv2/src/main.ino.cpp.o 生成LD脚本 .pioenvs/nodemcuv2/ld/local.eagle.app.v6.common.ld 存档 .pioenvs/nodemcuv2/libef5/libArduinoJson_ID64.a 归档 .pioenvs/nodemcuv2/libca3/libTaskScheduler_ID721.a 索引 .pioenvs/nodemcuv2/libef5/libArduinoJson_ID64.a 索引 .pioenvs/nodemcuv2/libca3/libTaskScheduler_ID721.a 编译 .pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/BearSSLHelpers.cpp.o 正在编译 .pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/CertStoreBearSSL.cpp.o 正在编译 .pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/ESP8266WiFi.cpp.o 正在编译 .pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/ESP8266WiFiAP.cpp.o 正在编译 .pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/ESP8266WiFi通用。cpp.o 编译 .pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/ESP8266WiFiMulti.cpp.o 编译 .pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/ESP8266WiFiSTA-WPS.cpp.o 正在编译 .pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/ESP8266WiFiSTA.cpp.o 编译.pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/ESP8266WiFi扫描.cpp.o 编译 .pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/WiFiClient.cpp.o 编译 .pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/WiFiClientSecureAxTLS.cpp.o 编译 .pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/WiFiClientSecureBearSSL.cpp.o 编译 .pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/WiFiServer.cpp.o 编译 .pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/WiFiServerSecureAxTLS.cpp.o 编译 .pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/WiFiServerSecureBearSSL.cpp.o 正在编译 .pioenvs/nodemcuv2/lib6c2/ESP8266WiFi/WiFiUdp.cpp.o 编译 .pioenvs/nodemcuv2/lib129/ESPAsyncTCP_ID305/AsyncPrinter.cpp.o 编译 .pioenvs/nodemcuv2/lib129/ESPAsyncTCP_ID305/ESPAsyncTCP.cpp.o 编译 .pioenvs/nodemcuv2/lib129/ESPAsyncTCP_ID305/ESPAsyncTCP缓冲区。cpp.o 归档 .pioenvs/nodemcuv2/lib6c2/libESP8266WiFi.a 索引 .pioenvs/nodemcuv2/lib6c2/libESP8266WiFi.a 编译 .pioenvs/nodemcuv2/lib129/ESPAsyncTCP_ID305/SyncClient.cpp.o 正在编译 .pioenvs/nodemcuv2/lib129/ESPAsyncTCP_ID305/tcp_axtls.c.o 正在编译 .pioenvs/nodemcuv2/lib3f1/painlessMesh_ID1269/TaskScheduler.cpp.o 编译 .pioenvs/nodemcuv2/lib3f1/painlessMesh_ID1269/painlessMesh.cpp.o 编译 .pioenvs/nodemcuv2/lib3f1/painlessMesh_ID1269/painlessMeshAP.cpp.o 归档 .pioenvs/nodemcuv2/lib129/libESPAsyncTCP_ID305.a 索引 .pioenvs/nodemcuv2/lib129/libESPAsyncTCP_ID305.a 编译 .pioenvs/nodemcuv2/lib3f1/painlessMesh_ID1269/painlessMesh通讯.cpp.o 编译 .pioenvs/nodemcuv2/lib3f1/painlessMesh_ID1269/painlessMesh连接。cpp.o 编译 .pioenvs/nodemcuv2/lib3f1/painlessMesh_ID1269/painlessMesh调试.cpp.o 编译 .pioenvs/nodemcuv2/lib3f1/painlessMesh_ID1269/painlessMeshJson.cpp.o .piolibdeps/painlessMesh_ID1269/src/painlessMeshComm.cpp: 在成员中 函数'String painlessMesh::buildMeshPackage(uint32_t, uint32_t, meshPackageType, String&)': .piolibdeps/painlessMesh_ID1269/src/painlessMeshComm.cpp:68:25: 错误: 没有匹配的函数来调用 'ArduinoJson6100_100::BasicJsonDocument::BasicJsonDocument()' 动态Json文档jsonBuffer; ^ .piolibdeps/painlessMesh_ID1269/src/painlessMeshComm.cpp:68:25: 注意: 候选人是:在包含的文件中 .piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/DynamicJsonDocument.hpp:7:0, 来自 .piolibdeps/ArduinoJson_ID64/src/ArduinoJson.hpp:21,来自 .piolibdeps/ArduinoJson_ID64/src/ArduinoJson.h:9, 来自 .piolibdeps/painlessMesh_ID1269/src/painlessMesh.h:12, 来自 .piolibdeps/painlessMesh_ID1269/src/painlessMeshComm.cpp:8: .piolibdeps/ArduinoJson_ID64/src/ArduinoJson/文档/BasicJsonDocument.hpp:50:3: 笔记: ArduinoJson6100_100::BasicJsonDocument::BasicJsonDocument(ArduinoJson6100_100::变量引用) [使用 TAllocator = ArduinoJson6100_100::DefaultAllocator] 基本Json文档(VariantRef src)^ .piolibdeps/ArduinoJson_ID64/src/ArduinoJson/文档/BasicJsonDocument.hpp:50:3: 注意:候选人期望 1 个参数,提供 0 个 .piolibdeps/ArduinoJson_ID64/src/ArduinoJson/文档/BasicJsonDocument.hpp:43:3: 注意:模板 ArduinoJson6100_100::BasicJsonDocument::BasicJsonDocument(常量 T&, 类型名 ArduinoJson6100_100::enable_if::value>::类型*) 基本Json文档(const T& src, ^ .piolibdeps/ArduinoJson_ID64/src/ArduinoJson/文档/BasicJsonDocument.hpp:43:3: 注意:模板参数 deduction/substitution 失败: .piolibdeps/painlessMesh_ID1269/src/painlessMeshComm.cpp:68:25: 注意: 候选人需要 2 个参数,提供 0 个参数 DynamicJsonDocument JSON缓冲区; ^ 在包含的文件中 .piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/DynamicJsonDocument.hpp:7:0, 来自 .piolibdeps/ArduinoJson_ID64/src/ArduinoJson.hpp:21,来自 .piolibdeps/ArduinoJson_ID64/src/ArduinoJson.h:9, 来自 .piolibdeps/painlessMesh_ID1269/src/painlessMesh.h:12, 来自 .piolibdeps/painlessMesh_ID1269/src/painlessMeshComm.cpp:8: .piolibdeps/ArduinoJson_ID64/src/ArduinoJson/文档/BasicJsonDocument.hpp:36:3: 笔记: ArduinoJson6100_100::BasicJsonDocument::BasicJsonDocument(常量 ArduinoJson6100_100::BasicJsonDocument&) [使用 TAllocator = ArduinoJson6100_100::DefaultAllocator] 基本Json 文档(const 基本Json 文档& src)^ .piolibdeps/ArduinoJson_ID64/src/ArduinoJson/文档/BasicJsonDocument.hpp:36:3: 注意:候选人期望 1 个参数,提供 0 个 .piolibdeps/ArduinoJson_ID64/src/ArduinoJson/文档/BasicJsonDocument.hpp:33:12: 笔记: ArduinoJson6100_100::BasicJsonDocument::BasicJsonDocument(size_t, TAllocator) [with TAllocator = ArduinoJson6100_100::DefaultAllocator; size_t = unsigned int] explicit BasicJsonDocument(size_t capa, TAllocator 分配器 = TAllocator()) ^ .piolibdeps/ArduinoJson_ID64/src/ArduinoJson/文档/BasicJsonDocument.hpp:33:12: 注意:候选人需要 2 个参数,提供 0 个 .piolibdeps/painlessMesh_ID1269/src/painlessMeshConnection.cpp: 在 成员函数'void MeshConnection::handleMessage(String&, uint32_t)': .piolibdeps/painlessMesh_ID1269/src/painlessMeshConnection.cpp:543:25: 错误:没有匹配的调用函数 'ArduinoJson6100_100::BasicJsonDocument::BasicJsonDocument()' 动态Json文档jsonBuffer; ^ .piolibdeps/painlessMesh_ID1269/src/painlessMeshConnection.cpp:543:25: 注意:候选人是:在包含的文件中 .piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/DynamicJsonDocument.hpp:7:0, 来自 .piolibdeps/ArduinoJson_ID64/src/ArduinoJson.hpp:21,来自 .piolibdeps/ArduinoJson_ID64/src/ArduinoJson.h:9, 来自 .piolibdeps/painlessMesh_ID1269/src/painlessMesh.h:12, 来自 .piolibdeps/painlessMesh_ID1269/src/painlessMeshConnection.cpp:9: .piolibdeps/ArduinoJson_ID64/src/ArduinoJson/文档/BasicJsonDocument.hpp:50:3: 笔记: ArduinoJson6100_100::BasicJsonDocument::BasicJsonDocument(ArduinoJson6100_100::变量引用) [使用 TAllocator = ArduinoJson6100_100::DefaultAllocator] 基本Json文档(VariantRef src)^ .piolibdeps/ArduinoJson_ID64/src/ArduinoJson/文档/BasicJsonDocument.hpp:50:3: 注意:候选人期望 1 个参数,提供 0 个 .piolibdeps/ArduinoJson_ID64/src/ArduinoJson/文档/BasicJsonDocument.hpp:43:3: 注意:模板 ArduinoJson6100_100::BasicJsonDocument::BasicJsonDocument(常量 T&, 类型名 ArduinoJson6100_100::enable_if::value>::类型*) 基本Json文档(const T& src, ^ .piolibdeps/ArduinoJson_ID64/src/ArduinoJson/文档/BasicJsonDocument.hpp:43:3: 注意:模板参数 deduction/substitution 失败: .piolibdeps/painlessMesh_ID1269/src/painlessMeshConnection.cpp:543:25: 注意:候选人需要 2 个参数,提供 0 个 DynamicJsonDocument JSON缓冲区; ^ 在包含的文件中 .piolibdeps/ArduinoJson_ID64/src/ArduinoJson/Document/DynamicJsonDocument.hpp:7:0, 来自 .piolibdeps/ArduinoJson_ID64/src/ArduinoJson.hpp:21,来自 .piolibdeps/ArduinoJson_ID64/src/ArduinoJson.h:9, 来自 .piolibdeps/painlessMesh_ID1269/src/painlessMesh.h:12, 来自 .piolibdeps/painlessMesh_ID1269/src/painlessMeshConnection.cpp:9: .piolibdeps/ArduinoJson_ID64/src/ArduinoJson/文档/BasicJsonDocument.hpp:36:3: 笔记: ArduinoJson6100_100::BasicJsonDocument::BasicJsonDocument(常量 ArduinoJson6100_100::BasicJsonDocument&) [使用 TAllocator = ArduinoJson6100_100::DefaultAllocator] 基本Json 文档(const 基本Json 文档& src)^ .piolibdeps/ArduinoJson_ID64/src/ArduinoJson/文档/BasicJsonDocument.hpp:36:3: 注意:候选人期望 1 个参数,提供 0 个 .piolibdeps/ArduinoJson_ID64/src/ArduinoJson/文档/BasicJsonDocument.hpp:33:12: 笔记: ArduinoJson6100_100::BasicJsonDocument::BasicJsonDocument(size_t, TAllocator) [with TAllocator = ArduinoJson6100_100::DefaultAllocator; size_t = unsigned int] explicit BasicJsonDocument(size_t capa, TAllocator 分配器 = TAllocator()) ^ .piolibdeps/ArduinoJson_ID64/src/ArduinoJson/文档/BasicJsonDocument.hpp:33:12: 注意:候选人需要 2 个参数,提供 0 个 .piolibdeps/painlessMesh_ID1269/src/painlessMeshConnection.cpp:544:16: 错误:'ArduinoJson6100_100::DynamicJsonDocument' 没有名为的成员 'nestingLimit' jsonBuffer.nestingLimit = 255; ^ * [.pioenvs/nodemcuv2/lib3f1/painlessMesh_ID1269/painlessMeshComm.cpp.o] 错误 1 * [.pioenvs/nodemcuv2/lib3f1/painlessMesh_ID1269/painlessMesh连接.cpp.o] 错误 1 ========================================== [错误] 用了 10.54 秒 ==== ==================================== 终端进程以退出代码终止:1

我做错了什么?

谢谢!

在库源中解决:https://gitlab.com/painlessMesh/painlessMesh/issues/253

作者评论:

Thanks for reporting. This should be fixed in the latest version (1.3.1). Let me know if you still have problems