cancel
Showing results for 
Search instead for 
Did you mean: 

Problems with C++ and STM32 extension in VS Code

JanusAudio
Associate II

I am having a hard time to set up a STM32 project in VS Code that works with all C++ features.

I set up my CMakeLists and enabled CXX language and add all my sources and so on.

When I keep my main.c and get my c++ functions with extern form a cpp file, the compiler does not find c++ functions like <cmath> that I include in my hpp headers.

I also tried setting up a project that I could open in VS Code and CubeIDE. In Cube IDE I renamed the main.c to main.cpp . And there in Cube IDE everything compiles fine.

In VS Code I get errors for the same project like and <cmath> is only found when I manually include the arm-none-eabi folder:

 undefined reference to `MX_SPI1_Init'",


What is the best way transform a CMake project from CubeMX to C++?

0 REPLIES 0