STM32-Bare-Metal icon indicating copy to clipboard operation
STM32-Bare-Metal copied to clipboard

undefined reference to `__aeabi_ddiv'

Open AdityaGawali opened this issue 5 years ago • 1 comments

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 avatar Feb 10 '20 10:02 AdityaGawali

@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.

ALTracer avatar Jul 03 '22 15:07 ALTracer