LVGL CYD Errors Compiling

Does anyone know why these errors occur and fails to compile? I understand that there are multiple SD libraries but the compiler is stating that only one of them are used.

Could you take me through the top 5 errors. The top 2 always appear but it compiles perfectly. The third, fourth and fifth have only just appeared.

I think the crash is due to errors three, four and five above the multiple SD library error/warning.

I’d add all of my code on here but there are 12 files (.ino, .h & .cpp) and there are a couple of thousand lines of code.

/Users/alexweir/Library/Arduino15/packages/esp32/tools/esp-x32/2411/bin/../lib/gcc/xtensa-esp-elf/14.2.0/../../../../xtensa-esp-elf/bin/ld: /Users/alexweir/Library/Caches/arduino/sketches/C857E1CEB535A5EF872F006E306DDD1B/sketch/objs.a(PhotoLib.cpp.o):/Users/alexweir/Documents/Arduino/CYD_Music_Photo_Station/PhotoLib.cpp:52: multiple definition of `z'; /Users/alexweir/Library/Caches/arduino/sketches/C857E1CEB535A5EF872F006E306DDD1B/sketch/objs.a(CYD_Music_Photo_Station.ino.cpp.o):/Users/alexweir/Documents/Arduino/CYD_Music_Photo_Station/CYD_Music_Photo_Station.ino:52: first defined here
/Users/alexweir/Library/Arduino15/packages/esp32/tools/esp-x32/2411/bin/../lib/gcc/xtensa-esp-elf/14.2.0/../../../../xtensa-esp-elf/bin/ld: /Users/alexweir/Library/Caches/arduino/sketches/C857E1CEB535A5EF872F006E306DDD1B/sketch/objs.a(PhotoLib.cpp.o):/Users/alexweir/Documents/Arduino/CYD_Music_Photo_Station/PhotoLib.cpp:52: multiple definition of `y'; /Users/alexweir/Library/Caches/arduino/sketches/C857E1CEB535A5EF872F006E306DDD1B/sketch/objs.a(CYD_Music_Photo_Station.ino.cpp.o):/Users/alexweir/Documents/Arduino/CYD_Music_Photo_Station/CYD_Music_Photo_Station.ino:52: first defined here
/Users/alexweir/Library/Arduino15/packages/esp32/tools/esp-x32/2411/bin/../lib/gcc/xtensa-esp-elf/14.2.0/../../../../xtensa-esp-elf/bin/ld: /Users/alexweir/Library/Caches/arduino/sketches/C857E1CEB535A5EF872F006E306DDD1B/sketch/objs.a(PhotoLib.cpp.o):/Users/alexweir/Documents/Arduino/CYD_Music_Photo_Station/PhotoLib.cpp:52: multiple definition of `x'; /Users/alexweir/Library/Caches/arduino/sketches/C857E1CEB535A5EF872F006E306DDD1B/sketch/objs.a(CYD_Music_Photo_Station.ino.cpp.o):/Users/alexweir/Documents/Arduino/CYD_Music_Photo_Station/CYD_Music_Photo_Station.ino:52: first defined here
/Users/alexweir/Library/Arduino15/packages/esp32/tools/esp-x32/2411/bin/../lib/gcc/xtensa-esp-elf/14.2.0/../../../../xtensa-esp-elf/bin/ld: warning: _floatdidf.o: missing .note.GNU-stack section implies executable stack
/Users/alexweir/Library/Arduino15/packages/esp32/tools/esp-x32/2411/bin/../lib/gcc/xtensa-esp-elf/14.2.0/../../../../xtensa-esp-elf/bin/ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker
collect2: error: ld returned 1 exit status
Multiple libraries were found for "SD.h"
  Used: /Users/alexweir/Library/Arduino15/packages/esp32/hardware/esp32/3.3.0/libraries/SD
  Not used: /Users/alexweir/Library/Arduino15/libraries/OLD_SD
  Not used: /Users/alexweir/Documents/Arduino/libraries/SD
exit status 1

Compilation error: exit status 1

UPDATE: Just realised that there are multiple definitions of x, y and z

The root cause of the compilation failure is the first three lines. Fixing these should result in a successful compilation, although you will still get warnings on lines 4 and 5 (likely due to the latest ESP32 board package 3.3.1).

.../CYD_Music_Photo_Station/PhotoLib.cpp:52: multiple definition of `z'; .../CYD_Music_Photo_Station.ino:52: first defined here
.../CYD_Music_Photo_Station/PhotoLib.cpp:52: multiple definition of `y'; .../CYD_Music_Photo_Station.ino:52: first defined here
.../CYD_Music_Photo_Station/PhotoLib.cpp:52: multiple definition of `x'; .../CYD_Music_Photo_Station.ino:52: first defined here

The compiler probably recognizes that the variables x, y, and z are defined as global variables in two files (PhotoLib.cpp and CYD_Music_Photo_Station.ino).

We can speculate on some possible causes and solutions, but we can't give accurate advice unless you post at least two files.