m5stack / M5Core2

M5Core2 Arduino Library
MIT License
267 stars 117 forks source link

error: conflicting declaration 'using EncodeRange = struct lgfx::v1::EncodeRange' using EncodeRange = lgfx::EncodeRange; #140

Closed GavinBeattie closed 5 months ago

GavinBeattie commented 1 year ago

Describe the bug

Error on compile in Arduino IDE that wasn't present before, guessing that Arduino auto library update triggered issue. Traced as far as:

include // No error with M5Unified.h

Error msg: In file included from /Users/.../Documents/Arduino/core2-base-iot/core2-base-iot.ino:4: /Users/.../Documents/Arduino/libraries/M5GFX/src/M5GFX.h:263:38: error: conflicting declaration 'using EncodeRange = struct lgfx::v1::EncodeRange' using EncodeRange = lgfx::EncodeRange; ^ In file included from /Users/.../Documents/Arduino/libraries/M5Core2/src/utility/In_eSPI.h:480, from /Users/.../Documents/Arduino/libraries/M5Core2/src/M5Display.h:10, from /Users/.../Documents/Arduino/libraries/M5Core2/src/M5Core2.h:12, from /Users/.../Documents/Arduino/core2-base-iot/core2-base-iot.ino:3: /Users/.../Documents/Arduino/libraries/M5Core2/src/Fonts/GFXFF/gfxfont.h:26:3: note: previous declaration as 'typedef struct EncodeRange EncodeRange' } EncodeRange; ^~~

To reproduce

Error on compile that wasn't present before, guessing that Arduino auto library update triggered issue.

include // No error with M5Unified.h

In file included from /Users/.../Documents/Arduino/core2-base-iot/core2-base-iot.ino:4: /Users/gavinbeattie/Documents/Arduino/libraries/M5GFX/src/M5GFX.h:263:38: error: conflicting declaration 'using EncodeRange = struct lgfx::v1::EncodeRange' using EncodeRange = lgfx::EncodeRange; ^ In file included from /Users/gavinbeattie/Documents/Arduino/libraries/M5Core2/src/utility/In_eSPI.h:480, from /Users/gavinbeattie/Documents/Arduino/libraries/M5Core2/src/M5Display.h:10, from /Users/gavinbeattie/Documents/Arduino/libraries/M5Core2/src/M5Core2.h:12, from /Users/gavinbeattie/Documents/Arduino/core2-base-iot/core2-base-iot.ino:3: /Users/gavinbeattie/Documents/Arduino/libraries/M5Core2/src/Fonts/GFXFF/gfxfont.h:26:3: note: previous declaration as 'typedef struct EncodeRange EncodeRange' } EncodeRange; ^~~

Expected behavior

No errors

Screenshots

No response

Environment

Additional context

No response

Issue checklist

andrea-casalicchio-crs commented 11 months ago

Exactly the same error here:

Environment #1 OS: macOS IDE &IDE Version: PlaformIO Core 6.1.11

Environment #2 OS: macOS IDE &IDE Version: Arduino IDE Latest

Environment #3 OS: Windows 11 IDE &IDE Version: PlaformIO Core 6.1.11

Clement-HU commented 9 months ago

Environment that is possible to compile: libraries' versions: M5Core2-v0.1.3 and M5GFX-v0.1.8 OS:Windows 10 IDE&IDE Version:Arduino-v2.0.0 Man those versions are are all too old!

Clement-HU commented 9 months ago

So newer versions seem to be buggier?

lbuque commented 6 months ago

@GavinBeattie I installed M5Core2 0.1.9 and no errors were encountered during compilation. Please provide test code.