简体   繁体   English

libstdc++ 中的符号名称约定

[英]Symbol names convention in libstdc++

During building a library I got the following "undefined reference" error:在构建库期间,我收到以下“未定义引用”错误:

libtbb.so.2: undefined reference to `__cxa_init_primary_exception@CXXABI_1.3.11'

When I checked the symbols in my libstdc++ library I saw the following当我检查我的 libstdc++ 库中的符号时,我看到了以下内容

nm -CD libstdc++.so.6.0.24 | grep "__cxa_init_primary_exception"
000000000008fdd8 T __cxa_init_primary_exception@@CXXABI_1.3.11

So the only difference between the symbol name in libstdc++.so and what libtbb.so seems to require is an additional "@" in the symbol name.因此,libstdc++.so 中的符号名称与 libtbb.so 似乎需要的符号名称之间的唯一区别是符号名称中的附加“@”。 Even more interesting if I type如果我打字会更有趣

nm -C libtbb.so.2 | grep "__cxa_init_primary_exception"
                 U __cxa_init_primary_exception@@CXXABI_1.3.11

I see that libtbb requires a symbol which actually includes a double @.我看到 libtbb 需要一个实际上包含双 @ 的符号。 What's the ratio behind this naming convention and why does the linker search for a symbol name with one @?这个命名约定背后的比率是多少?为什么 linker 会搜索带有一个 @ 的符号名称?

Maybe related to a known issue ?也许与已知问题有关?

It's also mentioned here :这里也提到了

...current TBB has problems with gcc-libs, it's compiled with gcc-libs 7.x so you will get this error if you try to build OpenCV with newest TBB ...当前 TBB 存在 gcc-libs 问题,它是使用 gcc-libs 7.x 编译的,因此如果您尝试使用最新的 TBB 构建 OpenCV,您将收到此错误

Proposed solution there:那里提出的解决方案:

This is also posted here, workaround is you should install TBB 2017_20170412-1 from Arch Linux Archive.这也发布在这里,解决方法是您应该从 Arch Linux 存档安装 TBB 2017_20170412-1。 To do this, first install newest TBB and then downgrade it.为此,首先安装最新的 TBB,然后将其降级。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM