2022-08-08 03:33 AM
I have STM32CubeIDE C project already running for an application.
I am planning to integrate a GIT submodule (CPP code) for proprietary communication.
Is it possible to add the CPP module into existing C project and run?
Please assist.
Solved! Go to Solution.
2022-08-08 03:36 AM
Create the STM32 project with C++ target language option. This enables both, C and C++.
hth
KnarfB
2022-08-08 03:36 AM
Create the STM32 project with C++ target language option. This enables both, C and C++.
hth
KnarfB
2022-08-08 03:38 AM
Thanks for the reply.
Is it possible to add the CPP files to existing STM32CubeIDE project?
2022-08-08 04:05 AM
AFAIR not. Create a new dummy STM32 C++ project, delete its sources and move the existing code into it?
hth
KnarfB
2022-08-08 08:24 AM
It is possible to convert an existing project to use c and c++. In CubeIDE, select the desired project in the "Project Explorer" window. Right-click on the project and select "Convert to C++" (near the bottom of the menu).
You will need to update the project to find the new include files and new source files. To add include directories go to project properties, the "C/C++ Build-> Settings". Look for "Include Paths" and add your new include directory. Do this al ALL BUILD TYPES (i.e. debug and release) as well as both "MCU GCC Compiler" and "MCU C++ Compiler" settings. To add the source directory, in the project properties select "C/C++ General->Paths and Symbols". Click on the "Source Location" tab and add the folder with your new files.
2023-11-20 01:54 AM
2023-11-20 02:06 AM
1. for new -> project -> stm32project -> select cpu -> then:
- give name + sel. c++
2. on existing project right mouse click -> on existing project
- then choose : convert to c++
ok?
2023-11-20 03:18 AM
Please learn to in-line images into posts, doing it as attachments with the same name is particular tedious under Android.. Thanks