I bought an ESP32 to try instead of an Arduino Mega. But I ran into a problem with my program. The program has the function of controlling the stepper motor through the LCD display and it runs without problems on Arduino Mega, but when I changed the board to ESP32 I had a problem with compilation. The biggest problem was with the libraries, which ESP probably doesn't support, but I somehow solved most of them, but I still can't solve this error. It has some problem with undefined reference to SPI. Does anyone know what to do with it? c:/users/kabic/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\kabic\AppData\Local\Temp\arduino\sketches\CDC8A33C5FCF4F11548CA88E6B41BEAB\sketch\ChickenGuard_V7_BETA_ESP32.ino.cpp.o:(.literal._Z5setupv+0x0): undefined reference to
SPI'
c:/users/kabic/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\kabic\AppData\Local\Temp\arduino\sketches\CDC8A33C5FCF4F11548CA88E6B41BEAB\sketch\ChickenGuard_V7_BETA_ESP32.ino.cpp.o:(.literal._Z5setupv+0xa0): undefined reference to SPIClass::begin(signed char, signed char, signed char, signed char)' c:/users/kabic/appdata/local/arduino15/packages/esp32/tools/xtensa-esp32-elf-gcc/esp-2021r2-patch5-8.4.0/bin/../lib/gcc/xtensa-esp32-elf/8.4.0/../../../../xtensa-esp32-elf/bin/ld.exe: C:\Users\kabic\AppData\Local\Temp\arduino\sketches\CDC8A33C5FCF4F11548CA88E6B41BEAB\sketch\ChickenGuard_V7_BETA_ESP32.ino.cpp.o: in function
SleepModeLogo()':
C:\Users\kabic\Desktop\Projekt\Automatická kurníková dvířka\Programy\ChickenGuard_V7_BETA_ESP32/ChickenGuard_V7_BETA_ESP32.ino:372: undefined reference to `SPIClass::begin(signed char, signed char, signed char, signed char)'
collect2.exe: error: ld returned 1 exit status
exit status 1
Compilation error: exit status 1`