2025-12-20 1:47 PM
Upgraded STM32CubeIDE to 2.0.0 and struggling with issues!
Installed CubeMX as a standalone program too.
Now I'm confused how to create a STM32 project and as usual select C++ as the target language.
1- Should I start from the IDE? There'll be no .ioc file then!
2- Should I start from CudeMX? There'll be no option to select C++ as the target language!
How to fix it?
My purpose is to keep main.c, create .hpp, .cpp files and include the header in main.c to be able to call the functions defined in the .cpp file.
Solved! Go to Solution.
2025-12-20 2:10 PM
Create the project in STM32CubeMX.
After you open it in STM32CubeIDE, right click the project and select "Convert to C++". This will add the C++ compiler and look for *.cpp files.
Then add whatever *.cpp files you want and it'll work. You'll need to extern "C" the ones you call in main.c so the names don't get mangled.
2025-12-20 2:10 PM
Create the project in STM32CubeMX.
After you open it in STM32CubeIDE, right click the project and select "Convert to C++". This will add the C++ compiler and look for *.cpp files.
Then add whatever *.cpp files you want and it'll work. You'll need to extern "C" the ones you call in main.c so the names don't get mangled.