HelTecAutomation / CubeCell-Arduino

Heltec CubeCell Series (based on ASR6501, ASR6502 chip) Arduino support.
248 stars 137 forks source link

LoRaWan_CayenneLPP Example doesn't build #216

Closed vschlegel closed 2 years ago

vschlegel commented 2 years ago

When trying to compile the LoRaWan_CayenneLPP Example, Arduino IDE will report the following error:

In file included from /home/val/Arduino/libraries/ArduinoJson/src/ArduinoJson.hpp:7,
                 from /home/val/Arduino/libraries/ArduinoJson/src/ArduinoJson.h:9,
                 from /home/val/Arduino/libraries/CayenneLPP/src/CayenneLPP.h:11,
                 from /home/val/.arduino15/packages/CubeCell/hardware/CubeCell/1.3.0/libraries/LoRa/examples/LoRaWAN/LoRaWan_CayenneLPP/LoRaWan_CayenneLPP.ino:3:
/home/val/Arduino/libraries/ArduinoJson/src/ArduinoJson/Configuration.hpp:235:2: error: #error nullptr is defined as a macro. Remove the faulty #define or #undef nullptr
 #error nullptr is defined as a macro. Remove the faulty #define or #undef nullptr
  ^~~~~
exit status 1
Error compiling for board CubeCell-Board(HTCC-AB01).

This is probably connected to https://github.com/bblanchon/ArduinoJson/issues/1355 but i have no idea how to fix this.

Versions i use:

Arduino IDE 1.8.19
CubeCell Development Framework 1.3.0
CayenneLPP 1.3.0
ArduinoJson 6.18.5
SebDominguez commented 2 years ago

This error was introduced by ArduinoJson since v6.17.0 This update added a build failure when nullptr is defined as a macro.

Until HelTecAutomation patch the Arduino framework themself (could take a while) you can try removing the macro yourself.

You'll find if on the following file

and remove the line 58 #define nullptr NULL

You can also remove the null pointer definition check inside ArduinoJson.