ArduinoJSON define as extern My sketch contains 2 .h files. one defines
on 1st .h file:
#define JSON_SIZE_IOT 400
#define JSON_SIZE_SKETCH 300
StaticJsonDocument&lt;JSON_SIZE_IOT&gt; paramJSON;
StaticJsonDocument&lt;JSON_SIZE_SKETCH&gt; sketchJSON;

and other need to define paramJSON and sketchJSON as extern
on 2nd .h file:
extern JsonDocument paramJSON;
extern JsonDocument paramJSON;

but I get this error:
error: conflicting declaration 'ArduinoJson6172_91::StaticJsonDocument&lt;400u&gt; paramJSON'
 StaticJsonDocument&lt;JSON_SIZE_IOT&gt; paramJSON;

....
: previous declaration as 'ArduinoJson6172_91::JsonDocument paramJSON'
 extern JsonDocument paramJSON;
For an extern the whole definition has to match the &quot;master&quot; definition.
So if you have:
StaticJsonDocument&lt;JSON_SIZE_IOT&gt; paramJSON;

then you extern has to be:
extern StaticJsonDocument&lt;JSON_SIZE_IOT&gt; paramJSON;

Of course you have to make sure your JSON_SIZE_IOT is the same for both - so it's best if that comes from a common source.
This is known as explicit instantiation declaration and you can read more about it in the Class template C++ reference.