cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure STM32CubeMX to support C++ development?

Ade J.3
Associate II

When I use CubeMX, the default language of my genereted code is C. I would like to develop in C++, as I can do in STM32CubeIDE. (I want to use VSCode to program)

Is there any option to do this? I've tried just change the main.c to main.cpp, but it didn't work.

(I'm a noob. So, if this questions is elementar, please, let me know likewise).

10 REPLIES 10

As CUBE-MX does have C++ option when using it in CUBEIDE, this is a valid question. 
With several KB sized flash memories as standard, the object oriented benefits of C++ are specialy usefull to new generation with more having C++ background then C.So question needs to be reopened