我正在从使用静态库的项目中构建一些遗留代码。现在,我收到很多这样的错误:
ld: warning: option -m is obsolete and being ignored
ld: duplicate symbol <function name>
有没有办法强制通过构建。据我所见,“重复”功能是相同的,只是构建过程出了问题。这个项目真的很大(还有一堆遗留的 c 和 c++ 代码),我真的想避免花几个小时研究构建过程。有“速战速决”吗?我真的只需要运行这个程序一次,所以我可以忍受(一些)稳定性问题。
最佳答案
来自 GNU ld
手册页:
--allow-multiple-definition
-z muldefs
Normally when a symbol is defined multiple times, the linker will
report a fatal error. These options allow multiple definitions and
the first definition will be used.
关于c++ - 强制忽略重复符号?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5669328/