How to fix ArduinoJSON: error: 'DynamicJSONDocument' was not declared in this scope

Problem:

While trying to compile your project, you see an error message like

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

Solution

The Json in DynamicJsonDocument must be spelled camel case: Json, not JSON! The correct spelling is DynamicJsonDocument.

If that does not help, ensure

example.cpp
#include <ArduinoJson.h>

is at the top of the file where the error occurs.


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