Platform run failing to build (stm32 + mbed-framework)

Hi I’m trying my first build based on the stm32 nucleo_l053r8 board.
I did the default init which created an mbed based project.
The running platform run it installed all of the tools (ststm32, toolchain, freamework-mbed and scons) without a hitch. But the build fails with:

Compiling .pioenvs/nucleo_l053r8/src/main.o
In file included from /Users//.platformio/packages/framework-mbed/hal/api/mbed.h:30:0,
from src/main.c:1:
/Users//.platformio/packages/framework-mbed/hal/api/platform.h:23:19: fatal error: cstddef: No such file or directory
compilation terminated.
*** [.pioenvs/nucleo_l053r8/src/main.o] Error 1

This implies the toolchain has not installed correctly, but checking under:

I can see is there!!!

Any suggestions?


  1. Do you use CPP extension for main file?
  2. If you have broken package installation, try to remove manually all PlatformIO packages from ~/.platformio/packages

Doh! of course…

It’s been a long week :wink:


Does it work now? Where the problem was hidden?

Yes it works fine now, it just needed the .cpp extension. Thanks again.

The “issues” came about because I’d used the:
as the test project.
This has a file called main.c not main.cpp