cancel
Showing results for 
Search instead for 
Did you mean: 

Getting the linker file issue on STM32CubeIDE - Undefined Reference

LuciferD
Associate II

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.

1 REPLY 1
Andrew Neil
Evangelist III

So is your other question resolved now?

https://community.st.com/t5/stm32cubeide-mcus/help-needed-migrating-from-microxplorer-to-stm32cubeide/td-p/663209

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.