2025-03-23 2:38 PM
Hello everyone,
I’m working on a project in STM32CubeIDE with C, and I’d like to add a C++ library. I’ve read that it’s possible to mix C and C++ using different compilers, but in my project settings (C/C++ Build > Settings > Paths and Symbols), I only see the GNU C compiler (arm-none-eabi-gcc).
How can I add the C++ compiler (arm-none-eabi-g++) in STM32CubeIDE?
Do I need to change any other settings to properly handle mixed C and C++ code in the project?
Thank you for your help!
Solved! Go to Solution.
2025-03-23 2:55 PM
Right click the project in the Project Explorer and select "Convert to C++".
2025-03-23 2:55 PM
Right click the project in the Project Explorer and select "Convert to C++".
2025-03-23 3:06 PM
Thank you for your reply!
I’d like to clarify — does "Convert to C++" change all my project files to C++, meaning main.c becomes main.cpp? Or does it just add the C++ compiler, allowing me to mix C and C++ in the same project?
2025-03-23 3:27 PM - edited 2025-03-23 3:28 PM
> does it just add the C++ compiler, allowing me to mix C and C++ in the same project?
This one. No files are changed. CubeMX still generates C files.