强制忽略重复符号?
我正在从使用静态库的项目构建一些遗留代码。现在,我收到很多这样的错误:
ld: warning: option -m is obsolete and being ignored
ld: duplicate symbol <function name>
有没有办法强制通过构建。从我所看到的“重复”功能是相同的,只是构建过程变得混乱。该项目确实很大(还有一堆遗留的 C 和 C++ 代码),我真的想避免花几个小时研究构建过程。有“快速解决办法”吗?我真的只需要运行这个程序一次,所以我可以忍受(一些)稳定性问题。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
来自 GNU ld 手册页:
From the GNU
ld
man-page:在我的系统上搜索
man ld
(“重复”)时,出现了以下情况:尝试一下。也许它可以解决你的问题。
A search in
man ld
(for "duplicate"), on my system, brought this up:Try it. Maybe it solves your problem.
如果您使用的是 MinGW-W64,则可以使用 ld 选项
LDFLAGS="-Wl,-allow-multiple-definition"
If you're using MinGW-W64 then you can use the ld option
LDFLAGS="-Wl,-allow-multiple-definition"