2021-02-17 08:23 AM
I am trying to convert a C project to C++. In the previous version, there was a "Convert to C++" option in the properties. I can't find this in 1.5.1.
How to convert to C++ in the new version? Just changing the main.c to main.cpp doesn't do it. It just fails to recognize the main.cpp file and does not compile it.
Solved! Go to Solution.
2021-02-17 11:24 AM
Fixed. Uninstalled and reinstalled in a different directory. After I imported te hold projects, i now see the Convert to C++ option.
Thanks for your help. I did have to let the installer place the IDE in the director of its choosing, not where i would like it to be. I tried to put it in my Engineering directory and the project import process barfed. After another uninstall/reinstall, and import, it works fine.
2021-02-17 08:26 AM
No issue on my side based on 1.5.1 too.
On which target device are you relying on ? (in other words are you playing with some hierarchical project or not ?) Is your project a STM32Cube one ... .project file requires at min:
<natures>
<nature>com.st.stm32cube.ide.mcu.MCUProjectNature</nature>
<nature>org.eclipse.cdt.core.cnature</nature>
<nature>org.eclipse.cdt.managedbuilder.core.managedBuildNature</nature>
</natures>
2021-02-17 08:54 AM
I am trying to create a test project for using the USB on an STM32F302C6 part. I have existing code from the previous version, which compiles in C and CPP, as the code uses both. Now, I am trying to get the USB port to work properly. In my existing code, the USB does not initialize properly. The C-ONLY test code works just fine. I want to create test code in C and CPP to see if that is the issue. So, I have created the test project in 2 different ways. First is using FILE>NEW>STM32 Project from an Existing STM32CubeMX Configuration File (.ioc). I select cpp for the code set, but this does not work. Seems like it just ignores the setting. Second way is to go through CubeMX and import the previous .ioc file. This gives no way to generate or convert CPP projects.
My main issue I think is that the "Convet to C++" option is not there in the properties pulldown. Where else can I convert to CPP?
2021-02-17 09:05 AM
could you share your .project file ?
PS: you're right if FILE>NEW>STM32 Project from an Existing STM32CubeMX Configuration File (.ioc) usage sounds C++ option is ignored :( sounds like a bug ... BUT on my side I'm getting capability to convert to C++ Thanks expected menu
2021-02-17 09:07 AM
Takes care contextual menu if C/C++ conversion is only available if relying on Project explorer view selecting project itself (not working if selecting a .c / .h or ...)
2021-02-17 09:15 AM
2021-02-17 09:27 AM
Based on your .zip ... just importing it ... works for me
2021-02-17 09:49 AM
I might see it. My workspace reports as 1.3.0 while yours shows 1.5.1 . I think this is just a name.
I'll look into upgrading, or maybe de-installing and re-installing the IDE.
2021-02-17 10:00 AM
Mine. Not able to explain but yes maybe fresh install & fresh workspace may help sounds you've locally something weird ...
2021-02-17 11:24 AM
Fixed. Uninstalled and reinstalled in a different directory. After I imported te hold projects, i now see the Convert to C++ option.
Thanks for your help. I did have to let the installer place the IDE in the director of its choosing, not where i would like it to be. I tried to put it in my Engineering directory and the project import process barfed. After another uninstall/reinstall, and import, it works fine.