Skip to main content
timtim
Visitor II
September 5, 2019
Question

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

  • September 5, 2019
  • 4 replies
  • 906 views

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

This topic has been closed for replies.

4 replies

Khouloud ZEMMELI
ST Employee
September 5, 2019

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

Best Regards,

Khouloud.

Dave Nadler
Senior III
September 7, 2019

@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
Principal III
September 7, 2019
Cartu38 OpenDev
Graduate II
September 18, 2019

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.