cancel
Showing results for 
Search instead for 
Did you mean: 

"Convert to C++" missing on 1.5.1

JGold.2
Associate II

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.

1 ACCEPTED SOLUTION

Accepted Solutions
JGold.2
Associate II

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.

View solution in original post

10 REPLIES 10
Cartu38 OpenDev
Lead II

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>

JGold.2
Associate II

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?

Cartu38 OpenDev
Lead II

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

Cartu38 OpenDev
Lead II

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 ...)

JGold.2
Associate II

I am right-clicking on the project heading, not the individual file. The Convert option used to be there, so I know where it "SHOULD" be.

How can I upload the project? Can I just zip it and attach it here? Let's see if it works.

Here is my menu. Hope it is readable.

0693W000008GT5iQAG.bmp

Based on your .zip ... just importing it ... works for me

0693W000008GTDrQAO.jpg

JGold.2
Associate II

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.

0693W000008GTMPQA4.bmp

Mine. Not able to explain but yes maybe fresh install & fresh workspace may help sounds you've locally something weird ...

0693W000008GTReQAO.jpg

JGold.2
Associate II

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.