Undefined reference to vsnprintf_P esp8266_stage

I’m using the esp8266_stage platform and recently ran pio platform update and now I cannot link any of my previously working projects:

.pioenvs\interdependulum_1_upper\libFrameworkArduino.a(Print.o):(.text._ZN5Print8printf_PEPKcz+0x0): undefined reference to `vsnprintf_P'
.pioenvs\interdependulum_1_upper\libFrameworkArduino.a(Print.o): In function `Print::printf_P(char const*, ...)':
Print.cpp:(.text._ZN5Print8printf_PEPKcz+0x53): undefined reference to `vsnprintf_P'
Print.cpp:(.text._ZN5Print8printf_PEPKcz+0x8e): undefined reference to `vsnprintf_P'
collect2.exe: error: ld returned 1 exit status

I have about 4hrs to fix this, anyone got any ideas?

Does it work with Arduino IDE?


I’m also experiencing the problem. Spending last few hours of debugging it.
It appears that if I remove -D DEBUG flag from build - it’s compiling. Otherwise - it fails.
The problem started since I’ve updated to latest version.

I will try to migrate to Arduino IDE and check but it will take days (my project has thousands of lines and I was only able to build it with PlatformIO only so far).

@ivankravets is there any way of using previous version of espressif_stage with PlatformIO?
I was trying to use commands like:
platformio platform install GitHub - platformio/platform-espressif8266: Espressif 8266: development platform for PlatformIO

where @9a89e3f is one of the previous hashes but I’m always getting
AssertionError: Package version d192958 doesn’t satisfy requirements 9a89e3f

It looks that only the last package (with the latest repository hash) can be installed.

Hi, @tomaszbabiuk! What is your OS? What is the purpose of this -D DEBUG flag? I’ve just tried the latest espressif8266_stage platform and it works with -D DEBUG.


I was digging more and it looks that some of the dependencies I use are using DEBUG flag (as well as esp8266 arduino framework). The problematic libraries were EspAsyncWebServer and Sha256 (at least for me).

My code was using DEBUG flag as well which appears to be conflicting with arduino framework.

I’ve fixed the issue by replacing DEBUG in my code to sth different (like DEBUGLOG). I’m not using DEBUG flag anymore (so now there’s no conflict between arduino and my code). I know it’s a workaround but it’s working fine.

I hope my solution will help somebody if run into this problem again. It looks that the problem is related to some of the latest changes to esp8266 arduino framework (not platformio).

I can confirm this was the fix! I had defined ‘-DDEBUG=1’ to flag debug serial printing, evidently this is causing some deep issues. Changing to another debug symbol name worked perfectly.

Thanks tomaszbabiuk!