Skip to main content
RDe R.1
Associate
April 6, 2021
Solved

How to generate main.cpp with STM32CubeIDE

  • April 6, 2021
  • 1 reply
  • 3783 views

Hi,

I'm working on a project in c++ and every time the IDE generates main.c instead of updating my main.cpp file. The project is set to C++, but still it generates main.c. That's very annoying. Can i fix this?

This topic has been closed for replies.
Best answer by Cartu38 OpenDev

Not possible.

But main.c is not preventing you to add c++ contributions to your project ... you've just to consider to properly organize it.

See https://community.st.com/s/question/0D53W00000UAHz6SAH/there-is-a-plan-to-allow-stm32cubemx-for-generating-maincpp-instead-of-c-only-

Adding c++ material properly is not enough. Please takes care to convert your C project to C++ one in oder to get access to C++ toolchain. Rely on project context menu ... some Convert C to C++ feature is available.

1 reply

Cartu38 OpenDev
Cartu38 OpenDevBest answer
Graduate II
April 6, 2021

Not possible.

But main.c is not preventing you to add c++ contributions to your project ... you've just to consider to properly organize it.

See https://community.st.com/s/question/0D53W00000UAHz6SAH/there-is-a-plan-to-allow-stm32cubemx-for-generating-maincpp-instead-of-c-only-

Adding c++ material properly is not enough. Please takes care to convert your C project to C++ one in oder to get access to C++ toolchain. Rely on project context menu ... some Convert C to C++ feature is available.