STM32-Bare-Metal
STM32-Bare-Metal copied to clipboard
undefined reference to `__aeabi_ddiv'
When using division statements in C code, I get the following error.
/home/aditya/arm_os/toolchain/gcc-arm-none-eabi-9-2019-q4-major-x86_64-linux/gcc-arm-none-eabi-9-2019-q4-major/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: main.c:(.text.main+0x5c): undefined reference to
__aeabi_ddiv'
`
Similar undefined refrence error arises when using typecasting in C code.
@AdityaGawali
This linker error arises when ld cannot find arm builtins for long division, which are present in toolchain's libgcc.a
. Are you linking libgcc (-lgcc
) in your application?
As I can see, it's in the Makefile: https://github.com/al95/STM32-Bare-Metal/blob/master/Makefile#L98
Please post entire build command line and full build log.