compiling libstdc++ statically to a custom plugin
Hello,
I am building a custom plugin for MySQL version 5.5.20 that uses C++ STL.
I am trying to link it statically against libstdc++.
I am running build on RH5 and I am using gcc 3.4.6 configured with fPIC.
MySQL and all other plugins including example build fine.
My custom plugin has the following c++ declaration
...
static std::map<pthread_t, std::queue<std::string> > udfData;
...
It compiles and seemingly links libstdc++ statically but fails to install with the following message
errno: 2 undefined symbol: _ZNSt8_Rb_treeImSt4pairIKmSt5queueISsSt5dequeISsSaISsEEEESt10_Select1stIS7_ESt4lessImESaIS7_EE4findERS1_
nm reveals plenty of missing symbols against a plugin dynamic library.
I tried to experiment with example plugin in MySQL 5.5.20.
I was able to load it with <iostream> library dependency statically compiled in but was not able to load it with c++ code snippet similar to the one in my custom plugin. Symptoms are the same: undefined symbol.
Previously, I was able to build this custom plugin with MySQL 5.1.44.
That version of server is using configure instead of CMake.
Any hints on how to resolve this would be extremly appreciated.
Thanks,
Vadim
Subject
Views
Written By
Posted
compiling libstdc++ statically to a custom plugin
4875
January 31, 2012 10:36PM
Sorry, you can't reply to this topic. It has been closed.
Content reproduced on this site is the property of the respective copyright holders.
It is not reviewed in advance by Oracle and does not necessarily represent the opinion
of Oracle or any other party.