cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to generate C++ projects from CubeMX?

timtim
Associate

Hi!

I'm trying to program a STM32F031C6 with CubeIDE. The CubeMX tool puts out a Project that is c native. Since I wrote my program in C++, i'd like to Change it into a c++ Project. Doing this manually is very error prone. Is there an Option that I missed?

Yours

timtim

4 REPLIES 4
Khouloud ZEMMELI
ST Employee

​Hello @timtim​ , For the moment it's not possible ! But your request has been submitted to the team.

Best Regards,

Khouloud.

@timtim​ - Unfortunately, CubeMX can't directly generate a C++ project.

You can change the generated project's nature to C++.

Make sure to back up your project file before you regenerate the project (after changing pins for example),

because CubeMX will destroy anything you've modified (paths, settings, etc.)...

C++ works just fine with the above caveat.

@Khouloud GARSI​ - STM really needs to fix both problems:

  • C++ as an option in CubeMX
  • clobbering user settings in project file
Piranha
Chief II
Cartu38 OpenDev
Lead II

Let's have a try relying on Project Explorer view contextual menu. Select your project then right click. Some "Convert to C++" menu entry is promoted if C project. If C++ project "Convert to C" is available.