[STM32 USB Host] How to perform file indexing? (No such file or directory)

I am trying to build a sketch, based on a project from another IDE (STM32CubeIDE).

The Arduino IDE already has the library files, but is not finding these files that are already within the IDE's folder hierarchy.

How does the Arduino IDE know where each file is?

Modify the platform.txt or use the platform.local.txt to add it to the include path.
Or you can even use the build_opt.h.

Arduino_Core_STM32/platform.txt

compiler.stm.extra_include="-I{build.source.path}" "-I{build.core.path}/avr" "-I{build.core.path}/stm32" "-I{build.core.path}/stm32/LL" "-I{build.core.path}/stm32/usb" "-I{build.core.path}/stm32/usb/hid" "-I{build.core.path}/stm32/usb/cdc" "-I{build.system.path}/Drivers/{build.series}_HAL_Driver/Inc" "-I{build.system.path}/Drivers/{build.series}_HAL_Driver/Src" "-I{build.system.path}/{build.series}" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Core/Inc" "-I{build.system.path}/Middlewares/ST/STM32_USB_Device_Library/Core/Src"

Source: Support for USB Host/Device · Issue #960 · stm32duino/Arduino_Core_STM32 · GitHub

Properties defined in platform.local.txt will override the properties in platform.txt

https://forum.arduino.cc/index.php?topic=589501.0