Skip to main content
CFort.1
Associate
January 22, 2021
Question

Problem with Cube.AI and C++

  • January 22, 2021
  • 2 replies
  • 935 views

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 

    This topic has been closed for replies.

    2 replies

    fauvarque.daniel
    ST Employee
    January 22, 2021

    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
    CFort.1Author
    Associate
    January 22, 2021

    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.