lexus2k / lcdgfx

Driver for LCD displays running on Arduino/Avr/ESP32/Linux (including Rasperry) platforms
MIT License
356 stars 51 forks source link

Error compiling for ESP32 after upgrading ESP32 platform from 1.0.6 to 2.0.5 #94

Open enfieldcat opened 1 year ago

enfieldcat commented 1 year ago

Describe the bug

miniThrottle compiles OK when using Arduino ESP platform 1.0.6

When compiling miniThrottle model train control using ESP32 platform version 2.0.5, the compile fails with: /home/ubuntu/.arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/gcc8_4_0-esp-2021r2-patch3/xtensa-esp32-elf/include/c++/8.4.0/bits/stl_vector.h: In member function 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::_M_check_len(std::vector<_Tp, _Alloc>::size_type, const char*) const': /home/ubuntu/Arduino/libraries/lcdgfx/src/nano_gfx_types.h:41:18: error: expected unqualified-id before '(' token #define max(a,b) ((a) > (b) ? (a) : (b))

To Reproduce Steps to reproduce the behavior: Compiled using arduino-cli on Ubuntu, In ~/.arduino15/arduino-cli.yaml , the board manager is set to

board_manager: additional_urls:

Otherwise, config of Arduino CLI is similar to that described at https://conferre.cf/HydraFerret/cli.php

To get code to compile with platform2, commented out the following two lines: /home/ubuntu/Arduino/libraries/lcdgfx/src/nano_gfx_types.h (line 41) /home/ubuntu/Arduino/libraries/lcdgfx/src/v2/lcd/base/ssd1306_common.inl (line 673)

Expected behavior Compilation without error.

Screenshots Some discussion around the bug in the context of lcdgfx: https://github.com/enfieldcat/ESP32_miniThrottle/issues

Please complete the following information:

Additional context Add any other context about the problem here.

lexus2k commented 1 year ago

Can you try the latest master branch. I cannot reproduce the issue using latest Arduino IDE, ESP32 Platform package and latest mainline