cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with Cube.AI and C++

CFort.1
Associate

Hi everyone. 

I'm writing a machine learning application for a master degree thesis. 

I would like to work with C++ but, for some reason, when the Cube.AI software pack is included in the project, the compiler doesn't recognize C++ keyword, such as "class".

Does anyone know why this happen ?

0693W000007CN6iQAG.png 

2 REPLIES 2
fauvarque.daniel
ST Employee

By default projects created with STM32CubeMX (with or without X-CUBE-AI) are C projects.

You have to change the type of the project and the compiler to use in the IDE itself.

In STM32CubeIDE you can simply right click on the project and select "Convert to C++ project"

Regards

CFort.1
Associate

Hi @fauvarque.daniel​, thanks for the answer.

I already knew that and I changed this option during the creation of the project by selecting c++ as target languages.

Furthemore, I already coded in C++ some other projects of mine, also starting from C as target language and then changing in c++ by that operation, without any problems.

I think that when there is the AI library in the project, it can work only in C, or that is what the problem seems.

In the building settings there are active gcc and g++ for all the steps of building, and the build command is

make -j7

(My apologies for bad English ).

Thanks.