STM32CUBE - Implicit dependency _printf_float not found

I was trying to add float support to my project, so i tried adding build flag -Wl,-u _printf_float to my platformio.ini and it makes build fail with:
*** [.pio/build/custom/firmware.elf] Implicit dependency `/home/tosmaz/.platformio/platforms/ststm32/builder/_printf_float' not found, needed by target `.pio/build/custom/firmware.elf'.
I tried it with several STM32 projects.

1 Like

Full platformio.ini and minimal example code?

I will just put bare-minimum platformio project that makes this issue appear.
https://github.com/tosmaz/stm32floattest.git

Perhaps removing the space between the -u and the _printf_float (i.e. -Wl,-u_printf_float)? I thought single or double quotes around the lot would work, but the compile size didn’t change. Removing the space did make the resulting file bigger… over to you to test if it works or does something else entirely! :wink:

1 Like

Yes! It did the trick, removing space does work. Now it compiles correctly, and resulting binary formats floats properly.
To be clear, putting -Wl,-u_printf_float in build flags does the trick.

3 Likes