主题 : 怎么会出现这个错误undefined reference to `memset' 我都没用的这个memset这个函数 复制链接 | 浏览器收藏 | 打印
级别: 新手上路
UID: 31711
精华: 0
发帖: 9
金钱: 45 两
威望: 9 点
综合积分: 18 分
注册时间: 2010-11-04
最后登录: 2011-11-30
楼主  发表于: 2011-08-12 14:35

 怎么会出现这个错误undefined reference to `memset' 我都没用的这个memset这个函数

我程序里面压根就没用到这个memset 函数,怎么会出现这个错误的呢??


root@phg-ubuntu:/work/test/LD3320# make
arm-linux-gcc -Wall -O2 -c -o head.o head.S
arm-linux-gcc -Wall -O2 -c -o init.o init.c
arm-linux-gcc -Wall -O2 -c -o spi.o spi.c
arm-linux-gcc -Wall -O2 -c -o LDChip.o LDChip.c
arm-linux-gcc -Wall -O2 -c -o Reg_RW.o Reg_RW.c
arm-linux-gcc -Wall -O2 -c -o main.o main.c
arm-linux-ld  -Tuart.lds -o spi_elf head.o init.o spi.o LDChip.o Reg_RW.o main.o
LDChip.o: In function `LD_AsrAddFixed':
LDChip.c:(.text+0x140): undefined reference to `memset'
LDChip.c:(.text+0x174): undefined reference to `memcpy'
LDChip.c:(.text+0x19c): undefined reference to `memcpy'
LDChip.c:(.text+0x1b4): undefined reference to `memcpy'
make: *** [spi.bin] 错误 1

我程序里面也没有memcpy 这个函数,为什么会出现这个错误呢??
我用的交叉编译器 是这个版本的 ARM-Linux GCC 4.4.3
级别: 新手上路
UID: 55698
精华: 0
发帖: 27
金钱: 135 两
威望: 27 点
综合积分: 54 分
注册时间: 2011-09-22
最后登录: 2015-05-11
1楼  发表于: 2011-11-19 14:53

 回 楼主(kanyou222) 的帖子

遇到同样问题啦.............

楼主,是什么原因啊??
怎样解决的啊???
[ 此帖被zou_sky在2011-11-19 17:48重新编辑 ]