gpt4 book ai didi

C 程序不再在 Ubuntu 中编译

转载 作者:太空狗 更新时间:2023-10-29 15:27:01 26 4
gpt4 key购买 nike

我用 C 编写了一个程序,但在使用 gcc 进行编译时出现了这些错误。直到最近我才开始使用它们,我的程序也没有改变。

In function `_fini':
(.fini+0x0): multiple definition of `_fini'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crti.o:(.fini+0x0): first defined here
slots: In function `__data_start':
(.data+0x0): multiple definition of `__data_start'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o:(.data+0x0): first defined here
slots: In function `__data_start':
(.data+0x8): multiple definition of `__dso_handle'
/usr/lib/gcc/x86_64-linux-gnu/4.6/crtbegin.o:(.data+0x0): first defined here
slots:(.rodata+0x0): multiple definition of `_IO_stdin_used'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o:(.rodata.cst4+0x0): first defined here
slots: In function `_start':
(.text+0x0): multiple definition of `_start'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crt1.o:(.text+0x0): first defined here
slots: In function `_init':
(.init+0x0): multiple definition of `_init'
/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../x86_64-linux-gnu/crti.o:(.init+0x0): first defined here
/tmp/ccIlRWIn.o: In function `main':
slots.c:(.text+0x0): multiple definition of `main'
slots:(.text+0xe4): first defined here
/usr/lib/gcc/x86_64-linux-gnu/4.6/crtend.o:(.dtors+0x0): multiple definition of `__DTOR_END__'
slots:(.dtors+0x8): first defined here
/usr/bin/ld: error in slots(.eh_frame); no .eh_frame_hdr table will be created.
collect2: ld returned 1 exit status

最佳答案

您在输出文件名前忘记了 -o,因此链接器试图使用您的旧可执行文件作为输入。

关于C 程序不再在 Ubuntu 中编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14589022/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com