本文主要是介绍-o0优化编译报错(.fini+0x0): _fini 的多重定义,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
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
这篇关于-o0优化编译报错(.fini+0x0): _fini 的多重定义的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!