makefile错误,在线等待....
CC = gcc
LIB=-I/usr/include/mysql -L/usr/lib/mysql -lmysqlclient
CL=`pkg-config --cflags --libs gtk+-2.0 gthread-2.0`
OBJ=main.o face.o callback.o init.o write.o read.o thread.o error.o
all: $(OBJ) ice.h
$(CC) $(OBJ) -o ice $(LIB) $(CL)
main.o:main.c main.h thread.h face.h init.h read.h
$(CC) -c -g -Wall main.c $(LIB) $(CL)
face.o:face.c face.h callback.h
$(CC) -c -g -Wall face.c $(LIB) $(CL)
callback.o:callback.c callback.h write.h read.h thread.h
$(CC) -c -g -Wall callback.c $(LIB) $(CL)
init.o: init.c init.h error.h thread.h read.h
$(CC) -c -g -Wall init.c $(LIB) $(CL)
write.o:write.c write.h init.h thread.h error.h
$(CC) -c -g -Wall write.c $(LIB) $(CL)
read.o:read.c init.h read.h thread.h write.h
$(CC) -c -g -Wall read.c $(LIB) $(CL)
thread.o: thread.c thread.h read.h
$(CC) -c -g -Wall thread.c $(LIB) $(CL)
error.o: error.c error.h
$(CC) -c -g -Wall error.c $(LIB) $(CL)
clean:
rm -f $(OBJ)
我觉得挺简单的,但是make 后,出险的错误如下:
face.o(.data+0x24): In function `u1_set_p1':
/root/face.c:10: multiple definition of `Addr6054'
main.o(.data+0x24):/root/main.c:14: first defined here
face.o(.data+0x30): In function `u1_set_p1':
/root/face.c:11: multiple definition of `Addr6063'
main.o(.data+0x30):/root/main.c:14: first defined here
callback.o(.data+0x24): In function `set_back':
/root/callback.c:9: multiple definition of `Addr6054'
main.o(.data+0x24):/root/main.c:14: first defined here
callback.o(.data+0x30): In function `set_back':
/root/callback.c:9: multiple definition of `Addr6063'
main.o(.data+0x30):/root/main.c:14: first defined here
init.o(.data+0x24): In function `my_connect':
/root/init.c:10: multiple definition of `Addr6054'
main.o(.data+0x24):/root/main.c:14: first defined here
init.o(.data+0x30): In function `my_connect':
/root/init.c:10: multiple definition of `Addr6063'
main.o(.data+0x30):/root/main.c:14: first defined here
write.o(.data+0x24): In function `writecom':
/root/write.c:12: multiple definition of `Addr6054'
main.o(.data+0x24):/root/main.c:14: first defined here
write.o(.data+0x30): In function `writecom':
/root/write.c:15: multiple definition of `Addr6063'
main.o(.data+0x30):/root/main.c:14: first defined here
read.o(.data+0x24): In function `CRC16':
/root/read.c:13: multiple definition of `Addr6054'
main.o(.data+0x24):/root/main.c:14: first defined here
read.o(.data+0x30): In function `CRC16':
/root/read.c:15: multiple definition of `Addr6063'
main.o(.data+0x30):/root/main.c:14: first defined here
thread.o(.data+0x24): In function `ShowValueS':
/root/thread.c:11: multiple definition of `Addr6054'
main.o(.data+0x24):/root/main.c:14: first defined here
thread.o(.data+0x30): In function `ShowValueS':
/root/thread.c:11: multiple definition of `Addr6063'
main.o(.data+0x30):/root/main.c:14: first defined here
error.o(.data+0x24): In function `on_message':
/root/error.c:12: multiple definition of `Addr6054'
main.o(.data+0x24):/root/main.c:14: first defined here
error.o(.data+0x30): In function `on_message':
/root/error.c:12: multiple definition of `Addr6063'
main.o(.data+0x30):/root/main.c:14: first defined here
collect2: ld returned 1 exit status
make: *** [all] Error 1
调了一天也没有调通,
麻烦哪位看看,急用.....先谢过了
[ 本帖最后由 dqk0822 于 2006-4-8 05:41 编辑 ]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
谢谢各位啦,我发现了,原来是在头文件里声明的时候没有加EXTERN,多次包含导致的,真是不好意思,谢谢,谢谢各位关心....
重复定义,估计lz定义和申明没弄清
multiple definition 多次定义.
快睡着了