2024-04-18 06:42 AM
Hello,
I'm trying to build my project on STM32CubeIDE, there was some issues and errors which I got resolved after that when I'm trying to linking my project with the linker which is named as STM32F105RBTX_FLASH.ld. it's throwing an error
Error:
(.text.__libc_init_array+0x12): undefined reference to `_init'
collect2.exe: error: ld returned 1 exit status
make: *** [makefile:77: CAN.elf] Error 1
"make -j16 all" terminated with exit code 2. Build might be incomplete.
undefined reference to `HAL_CAN_AddTxMessage'
undefined reference to `HAL_GetTick'
undefined reference to `HAL_HalfDuplex_EnableTransmitter'
and many more like that. Please, if anybody help me out in resolving them it would be much appreciated.
2024-04-18 07:11 AM
So is your other question resolved now?
If so, please mark the solution in that thread.
An undefined reference means that you have called a function, but you haven't provided any definition of that function.
In the case of the HAL_ functions, the definitions would be in the hal_*.c files - so it sounds like you haven't added the HAL source files to your project.