强制忽略重复的符号?

| 我正在从使用静态库的项目中构建一些旧代码。现在,我收到很多这样的错误:
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.
    
在我的系统上以
man ld
进行搜索(“ \\ duplicate \”),结果是:
   --traditional-format
       For some targets, the output of ld is different in some ways from
       the output of some existing linker.  This switch requests ld to use
       the traditional format instead.

       For example, on SunOS, ld combines duplicate entries in the symbol
       string table.  This can reduce the size of an output file with full
       debugging information by over 30 percent.  Unfortunately, the SunOS
       \"dbx\" program can not read the resulting program (\"gdb\" has no
       trouble).  The --traditional-format switch tells ld to not combine
       duplicate entries.
尝试一下。也许它可以解决您的问题。     

要回复问题请先登录注册