How to tell CubeIDE to compile specific *.c files with C++ compiler ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-02 6:13 AM - edited ‎2024-12-03 2:41 AM
Hi,
How to tell CubeIDE to compile specific *.c files with C++ compiler ?
Changing suffix from *.c to *.cpp is not an option.
[edit] Changing the suffix from *.c to *.cpp is the least preferred option.
Thank you
- Labels:
-
STM32CubeIDE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-03 12:58 AM
@ferro wrote:"Compiler options can be modified per file."
Where, how ?
As I showed earlier
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-03 12:59 AM
As I said this does not work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-03 1:18 AM - edited ‎2024-12-04 5:57 AM
Thanks,
Andrew Neil suggested the same : 1st is suboptimal and 2nd does not work as this setting is at project level not a file. [Edit] It is supposed to be per file but seems to not work as described
‎2024-12-03 09:50 AM - edited ‎2024-12-03 10:26 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-03 1:27 AM - edited ‎2024-12-03 1:31 AM
You can exclude the file from build and build it separately using a make file. You can run this command prior to building as an extra build step. Then add the o-file to the linker: https://community.st.com/t5/stm32-mcus-products/how-to-link-an-already-generated-object-file-in-existing-project/m-p/124589/highlight/true#M22428
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-03 1:33 AM
Uf, this sounds scary. Seems the least annoying option is to change suffix to cpp, CubeIDE auto assign compiler based on that. And it's not possible to change it per file.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-03 1:37 AM
@ferro wrote:Uf, this sounds scary. Seems the least annoying option is to change suffix to cpp, CubeIDE auto assign compiler based on that. And it's not possible to change it per file.
Your first post said it was impossible to change the file extension. And now it suddenly is?
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-03 1:42 AM
Yes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-03 1:46 AM
Would rephrase it to "Changing suffix from *.c to *.cpp is the last option."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-03 2:02 AM
"Rightclick the file. Click properties. Click C/C++ General. Click Language mappings. Then select GNU C++ from the drop down menus."
Did you actually try this ? I did not get reply from Neil.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2024-12-03 4:07 AM
@ferro wrote:"Rightclick the file. Click properties. Click C/C++ General. Click Language mappings. Then select GNU C++ from the drop down menus."
Did you actually try this ? I did not get reply from Neil.
Did YOU try this? I don't have your project. Since it says it overwrites project wide settings I think it only overwrites project wide defaults for that file. It wouldn't make sense if it would overwrite settings for other files. What would be the point otherwise? I only tried to see if my project had such an option, but I'm not going to modify it.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.
