Skip to main content
Visitor II
July 25, 2025
Question

Does cubemx support generating main.cpp in cmake project?

  • July 25, 2025
  • 1 reply
  • 176 views

When I use cubeide, it is OK to select c++ as targeted language. However, I can not find such a option in cubemx. Does cubemx support to generate c++ project with cmake? If not, could it be supported in the future?

Raya_1-1753435456822.png

 

1 reply

TDK
Super User
July 25, 2025

CubeMX generates C code. There is no way to make it generate C++ code.

You can use C++ in your project by creating a different *.cpp file and calling a function in there from main().

"If you feel a post has answered your question, please click ""Accept as Solution""."