Skip to main content
timtim
Visitor II
Sep 5, 2019 7:56 AM UTC
Question

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

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
Sep 5, 2019 8:17 AM UTC

​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
Sep 7, 2019 2:33 PM UTC

@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
Sep 7, 2019 3:20 PM UTC
Cartu38 OpenDev
Graduate II
Sep 18, 2019 8:53 PM UTC

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.