platform-ststm32 icon indicating copy to clipboard operation
platform-ststm32 copied to clipboard

about build_flags in platformio.ini

Open hit-wpc opened this issue 3 years ago • 1 comments

In my platformio.ini , I use build_flags to add the path Mid/Blink,VS Code can find led.h in Mid/Blink.But when I compile the project,the console says undefined reference to `x_l_blue_blink_init'.

[platformio]
src_dir = Src
include_dir = Inc
lib_dir = lib
boards_dir = boards
default_envs = genericSTM32F411CE

[env:genericSTM32F411CE]
platform = ststm32
board = genericSTM32F411CE
framework = stm32cube
upload_protocol = jlink
debug_tool = jlink
build_flags = -IMid/Blink

hit-wpc avatar Apr 03 '22 06:04 hit-wpc

-I adds a search path for include headers (.h). The linker must be complaining about not being able to find actual code of that function (.c). Source files are not specified by -I but with platformio's src_filter

positron96 avatar Apr 15 '22 05:04 positron96