1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > c语言 link找不到函数 link失败 找不到库函数'sqrtf' math.h的头文件已经包含...

c语言 link找不到函数 link失败 找不到库函数'sqrtf' math.h的头文件已经包含...

时间:2021-09-10 01:33:17

相关推荐

c语言 link找不到函数 link失败 找不到库函数'sqrtf' math.h的头文件已经包含...

没有发现编译选项有什么区别,如下:

CASE1:link失败的console信息:

make all

make --no-print-directory pre-build

a9-linaro-pre-build-step

' '

make --no-print-directory main-build

'Building target: math_test.elf'

'Invoking: ARM v7 gcc linker'

arm-none-eabi-gcc -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -Wl,-build-id=none -specs=Xilinx.spec -Wl,-T -Wl,../src/lscript.ld -LE:/****/freeRTOS/export/freeRTOS/sw/freeRTOS/freertos10_xilinx_domain/bsplib/lib -o "math_test.elf" ./src/freertos_hello_world.o -Wl,--start-group,-lxil,-lfreertos,-lgcc,-lc,--end-group

d:/xilinx/vitis/.2/gnu/aarch32/nt/gcc-arm-none-eabi/bin/../lib/gcc/arm-none-eabi/8.2.0/../../../../arm-none-eabi/bin/ld.exe: ./src/freertos_hello_world.o: in function `main':

E:\****\math_test\Debug/../src/freertos_hello_world.c:64: undefined reference to `sqrt'

collect2.exe: error: ld returned 1 exit status

CASE2:使用另外一个xsa创建的工程,link可以通过,同样用到sqrt,以下为console信息:

make all

make --no-print-directory pre-build

a9-linaro-pre-build-step

' '

make --no-print-directory main-build

'Building target: math_test.elf'

'Invoking: ARM v7 gcc linker'

arm-none-eabi-gcc -mcpu=cortex-a9 -mfpu=vfpv3 -mfloat-abi=hard -Wl,-build-id=none -specs=Xilinx.spec -Wl,-T -Wl,../src/lscript.ld -LE:/***/freeRTOS/export/freeRTOS/sw/freeRTOS/freertos10_xilinx_domain/bsplib/lib -o "math_test.elf" ./src/freertos_hello_world.o -Wl,--start-group,-lxil,-lfreertos,-lgcc,-lc,--end-group

'Finished building target: math_test.elf'

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。