Errors when build Nextion examples

Hi, how to repair this errors? When I add #include “SPI.h” to source, then I have error with SD.h…
Arduino nano.

In file included from C:\Users\Grzegorz.platformio\lib\Nextion\NexUpload.cpp:16:0:
C:\Users\Grzegorz.platformio\lib\Nextion\NexUpload.h:19:17: fatal error: SPI.h: No such file or directory


  • Looking for SPI.h dependency? Check our library registry!
  • CLI > platformio lib search “header:SPI.h”
  • Web > PlatformIO Registry

compilation terminated.
*** [.pio\build\nanoatmega328\lib451\Nextion\NexUpload.cpp.o] Error 1
================================================================= [FAILED] Took 2.85 seconds

Which exact error? It may be necessary to add #include <SPI.h> to the main source file, or add lib_deps = SPI to the platformio.ini so that the library dependency finder can find it. Do you have a reproducable project with error?

1 Like