How to Solve platformio adding library error

Solve platformio add library error problem
Problem: Adding TFT_eSPI library prompted that SPI.h could not be found
In file included from .pio\libdeps\esp32dev\TFT_eSPI\TFT_eSPI.cpp:17:0:
.pio\libdeps\esp32dev\TFT_eSPI\TFT_eSPI.h:32:17: fatal error: SPI.h: No such file or directory
Solution: Add a sentence to the platformio.ini file
lib_ldf_mode = deep+

There may still be warnings, but no error will be reported
can be compiled successfully


Read More: