I am trying to write my own MySQL storage engine which uses a key-value store as a back-end.
I wrote now my first version which implements the mandatory parts and I am able to compile, link, and install my MySQL source instance. After doing so I tried to load my new plugin with the following command in the mysql console:
install plugin ramcloud soname 'ha_ramcloud.so';
The error I get is the following:
ERROR 1126 (HY000): Can't open shared library '/usr/local/mysql/lib/plugin/ha_ramcloud.so' (errno: 13 undefined symbol: _ZNSt8_Rb_treeImmSt9_IdentityImESt4lessImESaImEE8_M_eraseEPSt13_Rb_tree_nodeImE)
Now I have no idea how to debug this problem. The client library from the key-value store uses the -std=c++0x compiler flag and I start to think that this could be part of the problem. But when I check with ldd, my storage engine links against the same libstdc++ version as the other engines delivered with mysql which can be loaded without any problems.
Are there any tricks in how to figure out where this problem comes from?
EDIT: The symbol which does not get found is
std::_Rb_tree<unsigned long, unsigned long, std::_Identity<unsigned long>, std::less<unsigned long>, std::allocator<unsigned long> >::_M_erase(std::_Rb_tree_node<unsigned long>*)
This looks like something from libstdc++ (STL) and is probably from my use of std::set. How can this happen?
It was a stupid error: the MySQL build system uses the -fno-implicit-templates option. Removing this for my plugin solved the problem (I could also make an explicit instance, but since I program only a prototype this should be ok).