I am compiling a c++ application for the STM32F4 microcontroller. All my code compiles successfully, but the link step fails with the following error:
/tmp/ccGj7Wge.o: In function `LoopFillZerobss':
(.text.Reset_Handler+0x32): undefined reference to `main'
collect2: error: ld returned 1 exit status
I am familiar with typical cause for undefined reference to main errors, that is, trying to compile an application without a main present at all. However, I do have a main.cpp, and naturally, a main function within it. It compiles to main.o and this is linked in with the other object files created during compilation.
I am cross-compiling onto the STM32F407 and I'm running bare metal.
Anyone have any insight into this or seen this error before? The only place I see the LoopFillZerobss function is in the assembly startup file for the board.