当前位置: 技术问答>linux和unix
gcc helloworld 出现错误......
来源: 互联网 发布时间:2016-03-13
本文导语: [chenzhp@localhost ~]$ cd /home/chenzhp [chenzhp@localhost ~]$ gcc -o helloworld helloworld.c [chenzhp@localhost ~]$ gcc helloworld 顺利的完成了编译,我想查看结果,结果运行上面这个命令后,一大堆错误就出来了。有谁知道这是怎么回...
[chenzhp@localhost ~]$ cd /home/chenzhp
[chenzhp@localhost ~]$ gcc -o helloworld helloworld.c
[chenzhp@localhost ~]$ gcc helloworld
顺利的完成了编译,我想查看结果,结果运行上面这个命令后,一大堆错误就出来了。有谁知道这是怎么回事呢?
helloworld: In function `_start':
(.text+0x0): multiple definition of `_start'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crt1.o:(.text+0x0): first defined here
helloworld:(.rodata+0x0): multiple definition of `_fp_hw'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crt1.o:(.rodata+0x0): first defined here
helloworld: In function `_fini':
(.fini+0x0): multiple definition of `_fini'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crti.o:(.fini+0x0): first defined here
helloworld:(.rodata+0x4): multiple definition of `_IO_stdin_used'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crt1.o:(.rodata.cst4+0x0): first defined here
helloworld: In function `__data_start':
(.data+0x0): multiple definition of `__data_start'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crt1.o:(.data+0x0): first defined here
helloworld:(.rodata+0x8): multiple definition of `__dso_handle'
/usr/lib/gcc/i386-redhat-linux/4.1.2/crtbegin.o:(.rodata+0x0): first defined here
.................
[chenzhp@localhost ~]$ gcc -o helloworld helloworld.c
[chenzhp@localhost ~]$ gcc helloworld
顺利的完成了编译,我想查看结果,结果运行上面这个命令后,一大堆错误就出来了。有谁知道这是怎么回事呢?
helloworld: In function `_start':
(.text+0x0): multiple definition of `_start'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crt1.o:(.text+0x0): first defined here
helloworld:(.rodata+0x0): multiple definition of `_fp_hw'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crt1.o:(.rodata+0x0): first defined here
helloworld: In function `_fini':
(.fini+0x0): multiple definition of `_fini'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crti.o:(.fini+0x0): first defined here
helloworld:(.rodata+0x4): multiple definition of `_IO_stdin_used'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crt1.o:(.rodata.cst4+0x0): first defined here
helloworld: In function `__data_start':
(.data+0x0): multiple definition of `__data_start'
/usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crt1.o:(.data+0x0): first defined here
helloworld:(.rodata+0x8): multiple definition of `__dso_handle'
/usr/lib/gcc/i386-redhat-linux/4.1.2/crtbegin.o:(.rodata+0x0): first defined here
.................
|
[chenzhp@localhost ~]$ gcc helloworld 换成 ./helloworld