简体   繁体   中英

Undefined symbol “tbb internal Allocate” when loading shared library

some people using my shared library have problems loading it. I already told them to install "gcc-libs" as stated here .

I also told them to compile the shared library themselves, but without luck.

Are there other solutions to this problem?

This is a log file from the program which tries to load the plugin on CentOS6:

[23:16:57]   Failed (plugins/RouteConnectorPlugin.so: undefined symbol: _ZN3tbb8internal12NFS_AllocateEjjPv)
[23:16:57]  Loading plugin failed: RouteConnectorPlugin.so

The program is open source and located here , it's written in a mix of C and C++ (the program is compiled for x86 only).

If your shared library depends on another shared library you should link against it. Then when your library is linked into some other executable/shared library that dependency will be automatically loaded and users don't need to explicitly link against that dependency.

The undefined symbol is

$ c++filt _ZN3tbb8internal12NFS_AllocateEjjPv
tbb::internal::NFS_Allocate(unsigned int, unsigned int, void*)

which might come from the intel-tbb library you mentioned. Since this a dependency of your code users expect you to properly declare that dependency by linking it into your library.

See eg this answer on how to do this with with GCC.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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