当前位置:首页 > 编程笔记 > 正文
已解决

-o0优化编译报错(.fini+0x0): _fini 的多重定义

来自网友在路上 168868提问 提问时间:2023-10-30 04:26:09阅读次数: 68

最佳答案 问答题库688位专家为你答疑解惑

gcc -g -o0 ./UseGoogleCoredumper -lcoredumper ./UseGoogleCoredumper.c -std=c99执行后报错

./UseGoogleCoredumper:在函数‘_fini’中:
(.fini+0x0): _fini 的多重定义
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crti.o:(.fini+0x0):第一次在此定义
./UseGoogleCoredumper:在函数‘data_start’中:
(.data+0x0): __data_start 的多重定义
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o:(.data+0x0):第一次在此定义
./UseGoogleCoredumper:(.rodata+0x8): __dso_handle 的多重定义
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtbegin.o:(.rodata+0x0):第一次在此定义
./UseGoogleCoredumper:(.rodata+0x0): _IO_stdin_used 的多重定义
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o:(.rodata.cst4+0x0):第一次在此定义
./UseGoogleCoredumper:在函数‘_start’中:
(.text+0x0): _start 的多重定义
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crt1.o:(.text+0x0):第一次在此定义
./UseGoogleCoredumper:在函数‘_init’中:
(.init+0x0): _init 的多重定义
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/../../../../lib64/crti.o:(.init+0x0):第一次在此定义
/tmp/ccUj5JTy.o:在函数‘sig_func’中:
/root/code/./UseGoogleCoredumper.c:8: sig_func 的多重定义
./UseGoogleCoredumper:/root/code/./UseGoogleCoredumper.c:8:第一次在此定义
/tmp/ccUj5JTy.o:在函数‘MakeSignal’中:
/root/code/./UseGoogleCoredumper.c:19: MakeSignal 的多重定义
./UseGoogleCoredumper:/root/code/./UseGoogleCoredumper.c:19:第一次在此定义
/tmp/ccUj5JTy.o:在函数‘main’中:
/root/code/./UseGoogleCoredumper.c:28: main 的多重定义
./UseGoogleCoredumper:/root/code/./UseGoogleCoredumper.c:28:第一次在此定义
/usr/lib/gcc/x86_64-redhat-linux/4.8.5/crtend.o:(.tm_clone_table+0x0): __TMC_END__ 的多重定义
./UseGoogleCoredumper:(.data+0x8):第一次在此定义
/usr/bin/ld: error in ./UseGoogleCoredumper(.eh_frame); no .eh_frame_hdr table will be created.
collect2: 错误:ld 返回 1

原因是缺失-o,变成下面这样可以成功

gcc -g -o0 -o ./UseGoogleCoredumper -lcoredumper ./UseGoogleCoredumper.c -std=c99

查看全文

99%的人还看了

猜你感兴趣

版权申明

本文"-o0优化编译报错(.fini+0x0): _fini 的多重定义":http://eshow365.cn/6-27625-0.html 内容来自互联网,请自行判断内容的正确性。如有侵权请联系我们,立即删除!