1

I'm building a shared library with g++ 3.3.4. I cannot link to the library because I am getting

./BcdFile.RHEL70.so: undefined symbol: _ZNSt8_Rb_treeIjjSt9_IdentityIjESt4lessIjESaIjEE13insert_uniqueERKj

Which c++filt describes as

std::_Rb_tree<unsigned int, unsigned int, std::_Identity<unsigned int>, std::less<unsigned int>, std::allocator<unsigned int> >::insert_unique(unsigned int const&)

I thought this might have come from using hash_map, but I've taken that all out and switched to regular std::map. I am using g++ to do the linking, which is including -lstdc++.

Does anyone know what class would be instantiating this template? Or even better, which library I need to be linking to?

EDIT: After further review, it appears adding the -frepo flag when compiling has caused this, unfortunately that flag is working around gcc3.3 bug.

4

3 回答 3

1

std::_Rb_Tree might be a red-black tree, which would most likely be from using map. It should be part of libstdc++, unless your library is linking against a different version of libstdc++ than the application, which from what you've said so far seems unlikely.

EDIT: Just to clarify, the red-black tree is the underlying data structure in map. All that hash_map does is hash the key before using it, rather than using the raw value.

于 2008-09-26T21:01:54.657 回答
0

Try

#include < map > 
in the source file where you are using map.

于 2008-09-26T21:06:42.073 回答
0

您似乎有来自不同版本的 gcc 的 2 个不同的不兼容版本的 libstdc++.so。检查你的路径。

于 2008-09-27T02:14:15.233 回答