ThingPulse / espaper-weatherstation

WeatherStation for the 2.9" ESPaper modules
https://thingpulse.com/product-category/espaper-epaper-kits/
MIT License
90 stars 46 forks source link

espaper-weathersation does not compile with recent Arduino IDEs #28

Closed oe4dns closed 2 years ago

oe4dns commented 2 years ago

8<------------------------ BUG REPORT -----------------------------------------

Expected behavior

Downloading the latest espaper-weahtersation from Github, open the Arduiono project and Verify/Compile it

Actual behavior

The compilation step stops with several errors relating to "error: macro "max" requires 2 arguments, but only 1 given" Full error message is included


In file included from /home/andi/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/StreamDev.h:25,
                 from /home/andi/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h:31,
                 from /home/andi/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266WebServer/src/ESP8266WebServer.h:340,
                 from sketch/configportal.h:21,
                 from /home/andi/Documents/Coding/Arduino/ESPaper/espaper-weatherstation/espaper-weatherstation.ino:62:
/home/andi/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/StreamString.h:54:50: error: macro "max" requires 2 arguments, but only 1 given
   54 |         return std::numeric_limits<int16_t>::max();
      |                                                  ^
In file included from /home/andi/Documents/Coding/Arduino/ESPaper/espaper-weatherstation/espaper-weatherstation.ino:53:
/home/andi/Documents/Coding/Arduino/libraries/Mini_Grafx/src/MiniGrafx.h:79: note: macro "max" defined here
   79 | #define max(a,b) ((a)>(b)?(a):(b))
      | 
In file included from /home/andi/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h:31,
                 from /home/andi/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266WebServer/src/ESP8266WebServer.h:340,
                 from sketch/configportal.h:21,
                 from /home/andi/Documents/Coding/Arduino/ESPaper/espaper-weatherstation/espaper-weatherstation.ino:62:
/home/andi/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/StreamDev.h:51:50: error: macro "max" requires 2 arguments, but only 1 given
   51 |         return std::numeric_limits<int16_t>::max();
      |                                                  ^
In file included from /home/andi/Documents/Coding/Arduino/ESPaper/espaper-weatherstation/espaper-weatherstation.ino:53:
/home/andi/Documents/Coding/Arduino/libraries/Mini_Grafx/src/MiniGrafx.h:79: note: macro "max" defined here
   79 | #define max(a,b) ((a)>(b)?(a):(b))
      | 
In file included from /home/andi/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h:31,
                 from /home/andi/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266WebServer/src/ESP8266WebServer.h:340,
                 from sketch/configportal.h:21,
                 from /home/andi/Documents/Coding/Arduino/ESPaper/espaper-weatherstation/espaper-weatherstation.ino:62:
/home/andi/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/StreamDev.h:118:50: error: macro "max" requires 2 arguments, but only 1 given
  118 |         return std::numeric_limits<int16_t>::max();
      |                                                  ^
In file included from /home/andi/Documents/Coding/Arduino/ESPaper/espaper-weatherstation/espaper-weatherstation.ino:53:
/home/andi/Documents/Coding/Arduino/libraries/Mini_Grafx/src/MiniGrafx.h:79: note: macro "max" defined here
   79 | #define max(a,b) ((a)>(b)?(a):(b))
      | 
In file included from /home/andi/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266WebServer/src/ESP8266WebServer-impl.h:31,
                 from /home/andi/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/libraries/ESP8266WebServer/src/ESP8266WebServer.h:340,
                 from sketch/configportal.h:21,
                 from /home/andi/Documents/Coding/Arduino/ESPaper/espaper-weatherstation/espaper-weatherstation.ino:62:
/home/andi/.arduino15/packages/esp8266/hardware/esp8266/3.0.2/cores/esp8266/StreamDev.h:145:50: error: macro "max" requires 2 arguments, but only 1 given
  145 |         return std::numeric_limits<int16_t>::max();
      |                                                  ^
In file included from /home/andi/Documents/Coding/Arduino/ESPaper/espaper-weatherstation/espaper-weatherstation.ino:53:
/home/andi/Documents/Coding/Arduino/libraries/Mini_Grafx/src/MiniGrafx.h:79: note: macro "max" defined here
   79 | #define max(a,b) ((a)>(b)?(a):(b))
      | 
exit status 1
Error compiling for board Generic ESP8266 Module.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Test code

Code as downloaded from github

ESPaper Weather Station version

espaper-weatherstation master branch

Hardware

2.9″ ESPaper Plus Kit, but this is not relevant as it does not get to the upload to hadware step

8<------------------------ END BUG REPORT -------------------------------------

marcelstoer commented 2 years ago

The root cause appears to be with the MiniGrafx project defining min & max macros:

https://github.com/ThingPulse/minigrafx/blob/master/src/MiniGrafx.h#L78-L81

marcelstoer commented 2 years ago

https://twitter.com/arduinolibs/status/1477455663513145356 should fix this.

oe4dns commented 2 years ago

I can confirm, the problem is fixed. Thank you!