完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
在进入嵌入式开发时,只要包含有sin,cos,sqrt 等三角函数的时候总是无法正常的编译,而且会产生一些很奇怪的错误
lcd.o(.text+0x85c): In function `draw_heart': : undefined reference to `cos' lcd.o(.text+0x870): In function `draw_heart': : undefined reference to `__muldf3' lcd.o(.text+0x874): In function `draw_heart': : undefined reference to `__fixdfsi' lcd.o(.text+0x884): In function `draw_heart': : undefined reference to `sin' lcd.o(.text+0x898): In function `draw_heart': : undefined reference to `__muldf3' lcd.o(.text+0x89c): In function `draw_heart': : undefined reference to `__fixdfsi' lcd.o(.text+0x8b0): In function `draw_heart': : undefined reference to `__floatsidf' lcd.o(.text+0x8b4): In function `draw_heart': : undefined reference to `sqrt' lcd.o(.text+0x8b8): In function `draw_heart': : undefined reference to `__fixdfsi' lcd.o(.text+0x8e0): In function `draw_heart': : undefined reference to `__adddf3' lcd.o(.text+0x8fc): In function `draw_heart': : undefined reference to `__ltdf2' make: *** [lcd.bin] Error 1 我要怎样才能正常编译呢?makefile如下: CFLAGS := -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -ffreestanding lcd.bin : start.S lcd.c ARM-linux-gcc $(CFLAGS) -c -o start.o start.S arm-linux-gcc $(CFLAGS) -c -o lcd.o lcd.c arm-linux-ld -Ttext 0x0000000 start.o lcd.o -o lcds_elf arm-linux-ld -Tlcd.lds start.o lcd.o -o lcds_elf arm-linux-objcopy -O binary -S lcds_elf lcd.bin arm-linux-objdump -D -m arm lcds_elf > lcd.dis clean: rm -f lcd.dis lcd.bin lcds_elf *.o |
|
相关推荐
4个回答
|
|
老师,我具体应该加在什么地方呢?我加上了还是出现了之前的那种错误
|
|
|
|
这个后面加上试试 CFLAGS := -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -ffreestanding -lm
|
|
|
|
好像还是不行
book@book-desktop:~/Desktop/lcd$ make arm-linux-gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -ffreestanding -lm -c -o start.o start.S arm-linux-gcc: -lm: linker input file unused because linking not done arm-linux-gcc -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -ffreestanding -lm -c -o lcd.o lcd.c arm-linux-gcc: -lm: linker input file unused because linking not done arm-linux-ld -Ttext 0x0000000 start.o lcd.o -o lcds_elf lcd.o(.text+0x85c): In function `draw_heart': : undefined reference to `cos' lcd.o(.text+0x870): In function `draw_heart': : undefined reference to `__muldf3' lcd.o(.text+0x874): In function `draw_heart': : undefined reference to `__fixdfsi' lcd.o(.text+0x884): In function `draw_heart': : undefined reference to `sin' lcd.o(.text+0x898): In function `draw_heart': 这个问题都已经困扰我好几天了,我就调用了一个sin函数,死活都编译不过 |
|
|
|
|
|
|
|
只有小组成员才能发言,加入小组>>
197个成员聚集在这个小组
加入小组为什么点亮LED的例子放在NORFlash上跑会出现奇怪的现象?
2156 浏览 6 评论
1964 浏览 5 评论
韦东山老师推出的《玩转ARM裸机实战》课程将帮你以上问题一扫而光!
4521 浏览 1 评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 07:12 , Processed in 0.656863 second(s), Total 82, Slave 62 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号