cancel
Showing results for 
Search instead for 
Did you mean: 

How to generate main.cpp with STM32CubeIDE

RDe R.1
Associate

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?

1 ACCEPTED SOLUTION

Accepted Solutions
Cartu38 OpenDev
Lead II

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.

View solution in original post

1 REPLY 1
Cartu38 OpenDev
Lead II

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.