Skip to main content
TCash.1
Associate III
July 29, 2020
Question

STM32CubeIDE C++ Generation and Language Mapping

  • July 29, 2020
  • 1 reply
  • 3439 views

Hello Everyone,

I am having some trouble getting the STM32CubeIDE to work with C++ on my STM32F4 Project.

I have converted my project to a C++ project and Renamed source files withing the IDE.

This works ok and compiles fine. with g++ being used to compile the .cpp files.

However every time I use the .ioc generation tool, it remakes a new main.c file instead of updating my main.cpp file.

My First question is, is there an option I am missing that will change the code generation to generate .cpp files?

If not, my second plan of attack is to force use of the g++ compile on all the .c files using the language mapping dialog, this way I can continue to use the auto generation while using c++ features:

0693W000003BeD4QAK.png

However this does not seem to have an effect and the c files are still compiled with gcc:

0693W000003BeEHQA0.png

I would prefer to use the autogenerator, any help/advice is appreciated.

This topic has been closed for replies.

1 reply

TDK
July 29, 2020

As of the previous update, STM32CubeIDE/STM32CubeMX was not set up to generate C++ directly. Not sure if the latest update changed it.

"If you feel a post has answered your question, please click ""Accept as Solution""."