AnsweredAssumed Answered

Undefined reference to `sqrtf' - STM32F4 DSP library

Question asked by jespersen.thomas.001 on Aug 17, 2012
Latest reply on Aug 26, 2012 by fm

Hi there.

I am trying to get the STM32F4 DSP library to work together with the CoIDE (CooCox).

Currently I have compiled the DSP math library with GCC using Keil, where I opened the GCC library project.

I've then added the compiled library file, libarm_cortexM4lf_math.a, to the CoIDE project together with the FFT example source code.



and also selected the "FPU hard" compiler command.


Though when I try to compile the project the GCC linker gives me the following error:


      [cc] arm-none-eabi-gcc -O0 -nostartfiles -Wl, -mcpu=cortex-m4 -mthumb -LC:\CooCox\CoIDE\workspace\STM32F4_FFT -Wl,--gc-sections -Wl,-TC:\CooCox\CoIDE\workspace\STM32F4_FFT\arm-gcc-link.ld -g -o STM32F4_FFT.elf ..\obj\arm_fft_bin_example_f32.o ..\obj\startup_stm32f4xx.o ..\obj\stm32f4xx_rcc.o ..\obj\stm32f4xx_gpio.o ..\obj\system_stm32f4xx.o ..\obj\syscalls.o ..\obj\arm_fft_bin_data.o ..\obj\misc.o -L..\.. -larm_cortexM4lf_math

       [cc] C:\CooCox\CoIDE\workspace\STM32F4_FFT\libarm_cortexM4lf_math.a(arm_cmplx_mag_f32.o): In function `arm_sqrt_f32':


       [cc] C:\STM32F4xx_DSP_StdPeriph_Lib_V1.0.1\Libraries\CMSIS\DSP_Lib\Source\GCC/../../../Include/arm_math.h:5705: undefined reference to `sqrtf'


What can I do about the undefined reference to 'sqrtf'? If I try to use the sqrtf function in my main.c file it doesn't give me any errors as long as I remember "#include "math.h".

Has it something to do with the compiling of the library in Keil and then imported into CoIDE (but I used same toolchain)? Maybe something with the folder structure?


The complete project can be found in the following zip file:


Thank you in advance.


Best Regards

Thomas Jespersen