How to integrate CPP code into STM32CubeIDE C project?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-08 3: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.
- Labels:
-
STM32CubeIDE
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-08 3:36 AM
Create the STM32 project with C++ target language option. This enables both, C and C++.
hth
KnarfB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-08 3:36 AM
Create the STM32 project with C++ target language option. This enables both, C and C++.
hth
KnarfB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-08 3:38 AM
Thanks for the reply.
Is it possible to add the CPP files to existing STM32CubeIDE project?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-08 4:05 AM
AFAIR not. Create a new dummy STM32 C++ project, delete its sources and move the existing code into it?
hth
KnarfB
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2022-08-08 8: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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-20 1:54 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-20 2: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?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2023-11-20 3:18 AM
Please learn to in-line images into posts, doing it as attachments with the same name is particular tedious under Android.. Thanks
Up vote any posts that you find helpful, it shows what's working..
