如何修复 ArduinoJSON: error: 'DynamicJSONDocument' was not declared in this scope

问题:

尝试编译项目时,你看到类似这样的错误消息

arduinojson_error.txt
error: 'DynamicJSONDocument' was not declared in this scope

解决方案

DynamicJsonDocument 中的 Json 必须拼写为驼峰式:Json,而不是 JSON!正确的拼写是 DynamicJsonDocument

如果那不起作用,确保

include_arduinojson.h
#include <ArduinoJson.h>

在错误发生的文件顶部。


Check out similar posts by category: C/C++