gcc 链接器错误:找不到符号的版本节点
我正在尝试构建共享库,但出现以下错误:
libavformat.so:找不到版本节点 对于符号 av_dup_packet@LIBAVFORMAT_52
ld: 无法设置动态部分大小: 价值不高
有人知道这个错误意味着什么吗?主机是i586-linux 目标是arm-linux
编辑:已解决,请参阅评论
I'm trying to build a shared library, and I get the following error:
libavformat.so: version node not found
for symbol
av_dup_packet@LIBAVFORMAT_52ld:
failed to set dynamic section sizes:
Bad value
Does anybody knows what this error means? Host is i586-linux target is arm-linux
Edit: Resolved, see comments
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
需要其他人向我指出这一点,所以我想我最好把它放在这里,以便其他像我这样的人可以理解奥格尼安的答案:
这转化为在运行
后编辑
并将config.h
>./configureSYMVER
相关条目设置为 0。如下所示:It took someone else to point this out to me, so I thought I might as well put it on here so others like me can understand ognian's answer:
This translates to editing
config.h
after you run./configure
and making theSYMVER
-related entries are set to 0. Like so:哦,该函数已于 2009 年 4 月移至将
libavformat/util.c
复制到libavcodec/avpacket.c
中的新文件。 internal.h 中的注释明确指出:但是,当函数在库之间移动时,不可能保持二进制兼容性。
请注意,此错误已在 Chromium 项目中报告了一年多前。
顺便说一句,无需手动编辑
config.h
:您可以运行./configure --disable-symver
。Oh, the function was moved in April 2009 from
libavformat/util.c
to a new file inlibavcodec/avpacket.c
. The comment in internal.h states explicitly:But it is impossible to retain binary compatibility when a function is moved between libraries.
Note that this bug was reported in Chromium project more than a year ago.
By the way, there is no need to edit
config.h
manually: you can run./configure --disable-symver
.在将 libsctp 构建到自定义构建环境中时,我遇到了此错误。
符号版本控制在此处进行了解释,并且可以使用链接器脚本来控制它。就我而言,我可以通过添加到特定于目标的 LDFLAGS makefile 变量来拉入现有版本链接器脚本:
I ran into this error when building libsctp into a custom build environment.
Symbol Versioning is explained here and a linker script may be used to control it. In my case I was able to pull in the existing version linker script by adding to the target-specific LDFLAGS makefile variable:
它是由内联汇编指令
.symver
引起的。我的解决方案是手动修改生成的 config.h 以禁用版本节点符号。查看 内部.h第214-223行
It was caused by an inline assembly directive
.symver
. My solution was to manually modify the generated config.h to disable version nodes symbols.Check out internal.h lines 214-223