Undefined reference to 'lv_example_x_x' on PlatformIO

Hello I have a problem during the compilation of the LVGL libray if I put it in the lib folder of my PlatformIO project. The Bug appens only when i enable the compilation of an example. Here is the issue on the LVGL github where i explain all the details.
Following my last comment where I tried to fix by forcing the compilation of the examples folder of LVGL, using build_src_filter in my ini, i get this error:

Compiling .pio\build\blackpill_f401cc\libae4\lvgl\core\lv_obj_scroll.c.o
In file included from .pio\libdeps\blackpill_f401cc\TFT_eSPI\TFT_eSPI.cpp:16:
.pio\libdeps\blackpill_f401cc\TFT_eSPI\TFT_eSPI.h:32:10: 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  > https://registry.platformio.org/search?q=header:SPI.h

   32 | #include <SPI.h>
      |          ^~~~~~~
compilation terminated.
*** [.pio\build\blackpill_f401cc\libf81\TFT_eSPI\TFT_eSPI.cpp.o] Error 1
====================================== [FAILED] Took 27.77 seconds ======================================

So i tried to fix it by adding the SPI library under lib_deps in my .ini file and I get this different error:

Indexing .pio\build\blackpill_f401cc\libFrameworkArduino.a
Linking .pio\build\blackpill_f401cc\firmware.elf
c:/users/franc/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: .pio/build/blackpill_f401cc/libFrameworkArduino.a(main.cpp.o): in function `main':
main.cpp:(.text.startup.main+0x6): undefined reference to `setup'
c:/users/franc/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld.exe: main.cpp:(.text.startup.main+0xa): undefined reference to `loop'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\blackpill_f401cc\firmware.elf] Error 1
====================================== [FAILED] Took 39.21 seconds =====================================

At this point I don’t know what may be causing this. Nor i found the issue that retained the examples folder of LVGL from compiling

It’s extremely bad to overwrite the main() function when working with framework = arduino (it’s overwriting the main() function as defined by the Arduino core) as well as working in a .c file (needs to be .cpp). I recommend you to delete that file and write main.cpp instead as

#include "lvgl.h"
#include "app_hal.h"
#include "demos/lv_demos.h"

void setup() {

void loop() {