Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Force ignore duplicate symbols?

Tags:

c++

c

macos

ld

I am building some legacy code from projects that uses static libraries. Now, I get lots of errors like this:

ld: warning: option -m is obsolete and being ignored
ld: duplicate symbol <function name>

Is there a way to force through the build. From what I can see the "duplicate" functions are identical, it's just the build process thats gone haywire. The project is really large (and a mess of legacy c and c++ code) and I really want to avoid spending hours investigating the build process. Is there a "quick fix"? I really only need to run this program once, so I can live with (some) stability issues.

like image 981
Krumelur Avatar asked Apr 14 '11 20:04

Krumelur


1 Answers

From the GNU ld man-page:

       --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.
like image 178
Thomas Leonard Avatar answered Oct 08 '22 11:10

Thomas Leonard