linuxgccmysql++

MySQL++ library doesn't work after upgrading GCC


I was using mysql++ library and compiling with GCC 3.3.4.
That GCC version had some bugs so I upgraded to GCC 3.4.6.
After upgrading GCC I rebuilt mysql++ and recompiled my program. But now I get a segmentation fault error.

I get the following message:

./mysqlTest: Symbol `_ZTVSt15basic_stringbufIcSt11char_traitsIcESaIcEE' has different size in shared object, consider re-linking.
Segmentation fault

Is there anything I have to rebuild, relink or whatever so my apps work again ??
What about the mysql C API ?? mysql++ is a wrapper around it.
Should the mysql C API be rebuilt or something??

please help, I dont know what to do. I need to make this work.


Solution

  • After upgrading the C++ standard library from GCC 3.3 to GCC 3.4 you must recompile all libraries linking against it if your program uses them and at the same time also links directly against the standard C++ library. In your case, considering your follow-up, libdb_cxx-4.2 is at fault, so rebuild Berkeley DB 4.2. Basically, mysqlTest links against both the new C++ standard library and Berkeley DB, but Berkeley DB links against the old one. The linker will pull in symbols from both libraries, but the inline storage class for some of them probably changed, and the Berkeley DB will get confused.

    To check what libraries you use, run ldd against your binaries, then run ldd against each C++ library in the list.