LibPrintf library installs incomplete

LibPrintf(embeddedartistry/LibPrintf@^1.1.3) does not fully install via platformio it is missing at least the entire extra subfolder and so does not compile.

In file included from .pio\libdeps\644pa8m\LibPrintf\src\LibPrintf.cpp:1:0:
.pio\libdeps\644pa8m\LibPrintf\src\LibPrintf.h:5:10: fatal error: …/extras/printf/printf.h: No such file or directory
#include “…/extras/printf/printf.h”
^~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

[env:644pa8m]
platform = atmelavr
board = 644pa8m
framework = arduino
lib_deps = 
  chris--a/Keypad@^3.1.1
  embeddedartistry/LibPrintf@^1.1.3
build_flags =

Correct, I see that too when doing pio lib -g install "embeddedartistry/LibPrintf @ ^1.1.3". Possibly a default filter setting in the library download / registration? @ivankravets please have a look

1 Like

We just follow library.properties specification. See

The content of the extras folder is totally ignored by the Arduino development software; you are free to put anything inside.

So, we don’t keep “extra” files by default on our side. You can create library.json manifest and configure export field.

The alternative solution is to report issue to Issues · embeddedartistry/arduino-printf · GitHub and ask authors to move source code outside extras folder.

The content of the extras folder is totally ignored by the Arduino development software; you are free to put anything inside.

That doesn’t say the Arduino IDE deletes the extras folder when it downloads a library. This is an additional step taken by PlatformIO, and not a welcome one. The library works properly in the Arduino IDE, but not PlatformIO. The real question is: why is it being pushed onto me?

The printf.c/.h files were moved to the extras folder because printf.c is included directly by the LibPrintf.cpp file for a technical reason. I cannot stop the Arduino IDE from automatically compiling printf.c if it is placed in the src/ folder, so there are multiple definition errors. The move has worked great in the Arduino IDE, but not in PlatformIO.

Can I potentially refactor the upstream library to support the relocation back to src/ so it would work with PlatformIO? Sure, though it is quite low on my priority list. But I would also prefer if PlatformIO did not delete files when downloading the repository and then send people to me to fix that fact.