Toggle navigation
首页
问答
文章
积分商城
专家
专区
更多专区...
文档中心
返回主站
搜索
提问
会员
中心
登录
注册
linker链接报错
math.h数学函数库
rt-thread联合cubemx联合开发编译程序出现未定义sqrt
发布于 2024-02-04 10:25:15 浏览:230
订阅该版
程序计算公式中用到了sqrt函数,在程序上面也包含了数学库文件
,程序中多处使用sqrt函数,但只有此两处出现问题,将代码屏蔽问题消失,程序编译之后出现如下错误: ![代码.JPG](https://oss-club.rt-thread.org/uploads/20240204/81415add03102a4699fc7656e21c1190.jpg) ``` linking... arm-none-eabi-gcc -mcpu=cortex-m3 -mthumb -O0 -ffunction-sections -fdata-sections -Wall -g -gdwarf-2 -T "G:\LLJC-20240112\LLJC_STM32F103ZDT6_B1.0.2\LLJC_STM32F103ZDT6_B1.0.2\linkscripts\STM32F103ZD\link.lds" -Xlinker --gc-sections -Wl,-Map,"rtthread.map" -Xlinker --cref -o "rtthread.elf" ./rt-thread/src/clock.o ./rt-thread/src/components.o ./rt-thread/src/device.o ./rt-thread/src/idle.o ./rt-thread/src/ipc.o ./rt-thread/src/irq.o ./rt-thread/src/kservice.o ./rt-thread/src/mem.o ./rt-thread/src/mempool.o ./rt-thread/src/object.o ./rt-thread/src/scheduler.o ./rt-thread/src/signal.o ./rt-thread/src/thread.o ./rt-thread/src/timer.o ./rt-thread/libcpu/arm/cortex-m3/context_gcc.o ./rt-thread/libcpu/arm/cortex-m3/cpuport.o ./rt-thread/libcpu/arm/common/backtrace.o ./rt-thread/libcpu/arm/common/div0.o ./rt-thread/libcpu/arm/common/showmem.o ./rt-thread/components/libc/compilers/common/time.o ./rt-thread/components/finsh/cmd.o ./rt-thread/components/finsh/msh.o ./rt-thread/components/finsh/shell.o ./rt-thread/components/drivers/src/completion.o ./rt-thread/components/drivers/src/dataqueue.o ./rt-thread/components/drivers/src/pipe.o ./rt-thread/components/drivers/src/ringblk_buf.o ./rt-thread/components/drivers/src/ringbuffer.o ./rt-thread/components/drivers/src/waitqueue.o ./rt-thread/components/drivers/src/workqueue.o ./rt-thread/components/drivers/serial/serial.o ./rt-thread/components/drivers/misc/pin.o ./libraries/STM32F1xx_HAL_Driver/Src/Legacy/stm32f1xx_hal_can.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_can.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cec.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_crc.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dac.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dac_ex.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_eth.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_exti.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_hcd.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2s.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_irda.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_iwdg.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_mmc.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_nand.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_nor.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pccard.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pcd_ex.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rtc_ex.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_sd.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_smartcard.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_spi.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_sram.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_uart.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_usart.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_wwdg.o ./libraries/STM32F1xx_HAL_Driver/Src/stm32f1xx_ll_usb.o ./libraries/CMSIS/Device/ST/STM32F1xx/Source/Templates/gcc/startup_stm32f103xe.o ./libraries/CMSIS/Device/ST/STM32F1xx/Source/Templates/system_stm32f1xx.o ./drivers/board.o ./drivers/drv_adc.o ./drivers/drv_clk.o ./drivers/drv_common.o ./drivers/drv_eth.o ./drivers/drv_flash_f1.o ./drivers/drv_gpio.o ./drivers/drv_hwtimer.o ./drivers/drv_pwm.o ./drivers/drv_qspi.o ./drivers/drv_rtc.o ./drivers/drv_sdio.o ./drivers/drv_soft_i2c.o ./drivers/drv_spi.o ./drivers/drv_usart.o ./drivers/drv_usbd.o ./drivers/drv_usbh.o ./drivers/drv_wdt.o ./cubemx/Src/adc.o ./cubemx/Src/dma.o ./cubemx/Src/gpio.o ./cubemx/Src/iwdg.o ./cubemx/Src/main.o ./cubemx/Src/stm32f1xx_hal_msp.o ./cubemx/Src/stm32f1xx_it.o ./cubemx/Src/tim.o ./cubemx/Src/usart.o ./applications/main.o ./applications/user_adc_dma.o ./applications/user_crc.o ./applications/user_lltask.o ./applications/user_sys.o ./applications/user_lltask.o: In function `adc_dma_root_mean_square_data': G:\LLJC-20240112\LLJC_STM32F103ZDT6_B1.0.2\LLJC_STM32F103ZDT6_B1.0.2\Debug/../applications/user_lltask.c:779: undefined reference to `sqrt' G:\LLJC-20240112\LLJC_STM32F103ZDT6_B1.0.2\LLJC_STM32F103ZDT6_B1.0.2\Debug/../applications/user_lltask.c:780: undefined reference to `sqrt' collect2.exe: error: ld returned 1 exit status make: *** [makefile:59: rtthread.elf] Error 1 "make -j4 all" terminated with exit code 2. Build might be incomplete. ```
查看更多
0
个回答
默认排序
按发布时间排序
暂无答案,快来添加答案吧
撰写答案
登录
注册新账号
关注者
0
被浏览
230
关于作者
OONW_6902
这家伙很懒,什么也没写!
提问
2
回答
0
被采纳
0
关注TA
发私信
相关问题
1
math.h没有asin的程序
2
studio编译pow报错的问题
3
studio中进行对数运算的问题
4
math.h函数无法使用
5
studio中该如何调用math.h中的函数而链接不出错?
6
无法使用 math 函数 和 Studio 中的函数
7
rt thread studio 中math库如何使用,急求!!!
8
Nano项目自动添加的 CMSIS/Lib/GCC/ math库是错误的吗?
9
Stemwin编译出错
10
请问RT-Thread Studio编译报错:undefined reference to `log'该如何解决?
推荐文章
1
RT-Thread应用项目汇总
2
玩转RT-Thread系列教程
3
国产MCU移植系列教程汇总,欢迎查看!
4
机器人操作系统 (ROS2) 和 RT-Thread 通信
5
五分钟玩转RT-Thread新社区
6
【技术三千问】之《玩转ART-Pi》,看这篇就够了!干货汇总
7
关于STM32H7开发板上使用SDIO接口驱动SD卡挂载文件系统的问题总结
8
STM32的“GPU”——DMA2D实例详解
9
RT-Thread隐藏的宝藏之completion
10
【ART-PI】RT-Thread 开启RTC 与 Alarm组件
最新文章
1
使用百度AI助手辅助编写一个rt-thread下的ONVIF设备发现功能的功能代码
2
RT-Thread 发布 EtherKit开源以太网硬件!
3
rt-thread使用cherryusb实现虚拟串口
4
《C++20 图形界面程序:速度与渲染效率的双重优化秘籍》
5
《原子操作:程序世界里的“最小魔法单位”解析》
热门标签
RT-Thread Studio
串口
Env
LWIP
SPI
AT
Bootloader
Hardfault
CAN总线
FinSH
ART-Pi
USB
DMA
文件系统
RT-Thread
SCons
RT-Thread Nano
线程
MQTT
STM32
RTC
FAL
rt-smart
ESP8266
I2C_IIC
WIZnet_W5500
ota在线升级
UART
PWM
cubemx
freemodbus
flash
packages_软件包
BSP
潘多拉开发板_Pandora
定时器
ADC
GD32
flashDB
socket
中断
Debug
编译报错
msh
SFUD
keil_MDK
rt_mq_消息队列_msg_queue
at_device
ulog
C++_cpp
本月问答贡献
踩姑娘的小蘑菇
7
个答案
3
次被采纳
张世争
8
个答案
2
次被采纳
rv666
5
个答案
2
次被采纳
用户名由3_15位
11
个答案
1
次被采纳
KunYi
6
个答案
1
次被采纳
本月文章贡献
程序员阿伟
6
篇文章
2
次点赞
hhart
3
篇文章
4
次点赞
大龄码农
1
篇文章
2
次点赞
ThinkCode
1
篇文章
1
次点赞
Betrayer
1
篇文章
1
次点赞
回到
顶部
发布
问题
分享
好友
手机
浏览
扫码手机浏览
投诉
建议
回到
底部