[求助]gcc -og * *.c错误
发表于 : 2010-03-10 9:22
本想用gdb调试程序,结果-g编译时出现如下错误:
test64: In function `_start':
(.text+0x0): multiple definition of `_start'
/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crt1.o:(.text+0x0): first de
fined here
test64:(.rodata+0x0): multiple definition of `_fp_hw'
/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crt1.o:(.rodata+0x0): first
defined here
test64: In function `_fini':
/build/buildd/glibc-2.7/build-tree/i386-libc/csu/crti.S:41: multiple definitio
n of `_fini'
/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crti.o:/build/buildd/glibc-2
.7/build-tree/i386-libc/csu/crti.S:41: first defined here
test64:(.rodata+0x4): multiple definition of `_IO_stdin_used'
/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crt1.o:(.rodata.cst4+0x0): f
irst defined here
test64: In function `__data_start':
(.data+0x0): multiple definition of `__data_start'
/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crt1.o:(.data+0x0): first de
fined here
test64: In function `__data_start':
(.data+0x4): multiple definition of `__dso_handle'
/usr/lib/gcc/i486-linux-gnu/4.2.4/crtbegin.o:(.data+0x0): first defined here
test64: In function `_init':
/build/buildd/glibc-2.7/build-tree/i386-libc/csu/crti.S:15: multiple definitio
n of `_init'
/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crti.o:/build/buildd/glibc-2
.7/build-tree/i386-libc/csu/crti.S:15: first defined here
/tmp/ccweHNjO.o: In function `c_fun':
test64.c:(.text+0x0): multiple definition of `c_fun'
test64:(.text+0x84): first defined here
/tmp/ccweHNjO.o: In function `main':
test64.c:(.text+0x3f): multiple definition of `main'
test64:(.text+0xc3): first defined here
collect2: ld 返回 1
上面说我多次定义了这个那个。。。
同时gcc -o * *.c编译是可以通过的
怎么回事?怎么解决?
test64: In function `_start':
(.text+0x0): multiple definition of `_start'
/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crt1.o:(.text+0x0): first de
fined here
test64:(.rodata+0x0): multiple definition of `_fp_hw'
/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crt1.o:(.rodata+0x0): first
defined here
test64: In function `_fini':
/build/buildd/glibc-2.7/build-tree/i386-libc/csu/crti.S:41: multiple definitio
n of `_fini'
/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crti.o:/build/buildd/glibc-2
.7/build-tree/i386-libc/csu/crti.S:41: first defined here
test64:(.rodata+0x4): multiple definition of `_IO_stdin_used'
/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crt1.o:(.rodata.cst4+0x0): f
irst defined here
test64: In function `__data_start':
(.data+0x0): multiple definition of `__data_start'
/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crt1.o:(.data+0x0): first de
fined here
test64: In function `__data_start':
(.data+0x4): multiple definition of `__dso_handle'
/usr/lib/gcc/i486-linux-gnu/4.2.4/crtbegin.o:(.data+0x0): first defined here
test64: In function `_init':
/build/buildd/glibc-2.7/build-tree/i386-libc/csu/crti.S:15: multiple definitio
n of `_init'
/usr/lib/gcc/i486-linux-gnu/4.2.4/../../../../lib/crti.o:/build/buildd/glibc-2
.7/build-tree/i386-libc/csu/crti.S:15: first defined here
/tmp/ccweHNjO.o: In function `c_fun':
test64.c:(.text+0x0): multiple definition of `c_fun'
test64:(.text+0x84): first defined here
/tmp/ccweHNjO.o: In function `main':
test64.c:(.text+0x3f): multiple definition of `main'
test64:(.text+0xc3): first defined here
collect2: ld 返回 1
上面说我多次定义了这个那个。。。
同时gcc -o * *.c编译是可以通过的
怎么回事?怎么解决?