also i changed the c_cpp_properties.json.
so added the paths
Core\Src
Core\Inc
it builds and every thing works.
i get the following error.
Found 18 compatible libraries
Scanning dependencies…
No dependencies
Building in release mode
Linking .pio\build\disco_f051r8\firmware.elf
.pio\build\disco_f051r8\libFrameworkCMSISDevice.a(startup_stm32f051x8.o): In function LoopFillZerobss': (.text.Reset_Handler+0x32): undefined reference to main’
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\disco_f051r8\firmware.elf] Error 1
Doing a -I flag just means “add to include header serach path”, it will not build any source files inside those folders.
Nope. That one is autogenerated from the platformio.ini options, you should never modify that, because changes will be reset. You need to get the platformio.ini right, then a correct c_cpp_properties.json will follow naturally.
Cna you show a screenshot of your current project?
This makes no sense. Source files are supposed to be in src/. (Unless you do a hack with the src_dir setting). Please restructure your project to conform to the folder structure that PlatformIO expects: Source files that you want to build are to be placed in src/.