本想用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编译是可以通过的
怎么回事?怎么解决?
[求助]gcc -og * *.c错误
-
- 帖子: 4
- 注册时间: 2009-12-02 22:26
- i_NIX
- 帖子: 450
- 注册时间: 2008-02-11 15:46
Re: [求助]gcc -og * *.c错误
gcc -g *.c -o *.exe
其中,*.exe是生成的可执行程序。gcc的参数不要乱加, -o -g要分开
其中,*.exe是生成的可执行程序。gcc的参数不要乱加, -o -g要分开
Google Talk群组,请来<雨云>一番!
主题:Ubuntu、Linux、编程、科幻、民主、科学等。
添加 [email protected] 为好友(然后say hi,并等待验证)
参见 http://goo.gl/xIpxH
Twitter:http://twitter.com/nixzhu
主题:Ubuntu、Linux、编程、科幻、民主、科学等。
添加 [email protected] 为好友(然后say hi,并等待验证)
参见 http://goo.gl/xIpxH
Twitter:http://twitter.com/nixzhu
-
- 帖子: 4
- 注册时间: 2009-12-02 22:26
Re: [求助]gcc -og * *.c错误
很感谢NIX的帮助,确实可以gdb了
不过之前我已这样用过很多次,都没有出现任何情况
最近更新过系统后,就开始出错了
再次感谢
不过之前我已这样用过很多次,都没有出现任何情况
最近更新过系统后,就开始出错了
再次感谢
- i_NIX
- 帖子: 450
- 注册时间: 2008-02-11 15:46
Re: [求助]gcc -og * *.c错误
不客气。
不同版本可能有差别。
不同版本可能有差别。
Google Talk群组,请来<雨云>一番!
主题:Ubuntu、Linux、编程、科幻、民主、科学等。
添加 [email protected] 为好友(然后say hi,并等待验证)
参见 http://goo.gl/xIpxH
Twitter:http://twitter.com/nixzhu
主题:Ubuntu、Linux、编程、科幻、民主、科学等。
添加 [email protected] 为好友(然后say hi,并等待验证)
参见 http://goo.gl/xIpxH
Twitter:http://twitter.com/nixzhu
-
- 帖子: 3173
- 注册时间: 2010-01-13 23:26