Skip to main content
srikanth
Associate III
December 29, 2020
Solved

undefined reference to `main' error while Convert C project to CPP in STMCUBE IDE.

  • December 29, 2020
  • 1 reply
  • 5062 views

0693W000006H2TSQA0.pnghello,

I am trying to convert c project to CPP in STMCUBE IDE,

Now I generate the code to STM32H745(Dual core) and convert to CPP by using convert to CPP option in CUBE IDE.

I am getting following error

undefined reference to `main'. (check in attached screenshot)

But same way I generated code to single core MCU, I did not get this error.

Now how can I resolve this issue.

This topic has been closed for replies.
Best answer by KnarfB

Check that you have converted both sub-projects CM4 and CM7 to C++ and make a clean build. Works here with STMCubeIDE 1.5.1.

The term "convert" is IMHO misleading, it only changes the tool chain settings to enable C++ compilation.

1 reply

KnarfB
KnarfBBest answer
Super User
December 29, 2020

Check that you have converted both sub-projects CM4 and CM7 to C++ and make a clean build. Works here with STMCubeIDE 1.5.1.

The term "convert" is IMHO misleading, it only changes the tool chain settings to enable C++ compilation.