bblanchon / ArduinoJson

📟 JSON library for Arduino and embedded C++. Simple and efficient.
https://arduinojson.org
MIT License
6.69k stars 1.12k forks source link

Error: nullptr defined as a macro on ESP8266 Arduino IDE (Visuino) #1420

Closed detmot5 closed 3 years ago

detmot5 commented 3 years ago

Hey, I got an error while compiling library on ESP8266 with Visuino generated code.

error: #error nullptr is defined as a macro. Remove the faulty #define or #undef ullptr

error nullptr is defined as a macro. Remove the faulty #define or #undef nullptr

I also found out how to fix it.

In file Configuration.h where we have

if __cplusplus >= 201103L

i inserted

ifdef nullptr

undef nullptr

endif

I already made pull request

bblanchon commented 3 years ago

Hi @detmot5,

As I said in PR #1421, this error message is there on purpose; see #1355.

It's not the job of ArduinoJson to fix the mess introduced by other libraries. Please submit a patch to the library that defines nullptr as a macro, or place the #undef in your main program.

Thank you for your understanding.

Best regards, Benoit