如何链接arm数学库来编译stm32f4

时间:2016-03-12 11:43:00

标签: c gcc linker arm stm32f4discovery

我正在尝试计算stm32f4上的FFT

我得到的第一个错误是:

/home/mennesker/Workspace/stm/STM-mainopdracht2/main.c:111: undefined reference to `arm_cfft_radix4_init_f32'
/home/mennesker/Workspace/stm/STM-mainopdracht2/main.c:114: undefined reference to `arm_cfft_radix4_f32'
/home/mennesker/Workspace/stm/STM-mainopdracht2/main.c:117: undefined reference to `arm_cmplx_mag_f32'
/home/mennesker/Workspace/stm/STM-mainopdracht2/main.c:120: undefined reference to `arm_max_f32'

所以我认为我需要链接库,因为在包含文件中只有.h文件。

库位于同一根文件夹中,因此,  .h文件(arm_math.h和core_cm4.h)位于文件夹中:

/home/mennesker/Workspace/stm/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/Include/

库arm_cortexM4b_math.lib位于文件夹:

/home/mennesker/Workspace/stm/STM32F4-Discovery_FW_V1.1.0/Libraries/CMSIS/Lib/ARM/

我尝试了许多不同的路径变量,使用-l arm_cortexM4b_math.lib作为链接器选项或-l <path to file> /arm_cortexM4b_math.lib

将库链接到哪里

但我仍然得到错误:

/usr/bin/../lib/gcc/arm-none-eabi/4.9.3/../../../../arm-none-eabi/bin/ld: cannot find -larm_cortexM4b_math.lib

我不知道链接器的外观以及此链接的确如何工作

0 个答案:

没有答案