views:

227

answers:

5

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.

A: 

Did you 'make clean' before rebuilding mysql++?

Seems like the mysqlTest program wasn't recompiled and is still wanting the previous lib.

If you did do make clean (supposing mysqlTest is a program coming in the package), did you 'ldconfig' after installing the new library?

Vinko Vrsalovic
A: 

Yes, I did "make clean" before rebuilding.
mysqlTest is a program of mine. I still have the version I compiled before upgrading GCC and it works fine. But the one I compiled after upgrading gives that error.

I did ldconfig too, and I get this message:

ldconfig: /usr/lib/libdb_cxx-4.2.so is not a symbolic link

I dont know if that's just a warning or if it means that the process was interrupted.

GetFree
+2  A: 

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.

Mihai Limbășan
Thanks. Edited it a bit to clarify.
Mihai Limbășan
A: 

In reply to moocha:

I rebuilt some other things my app was using and I manage to make a simple program to work.

I still have some problems with complex programs though, which i'm trying so solve.

I'm pretty sure the libdb_cxx-4.2.so thing is not the problem because I remember I saw that message some time ago when I ran ldconfig. Even so, how can I get rid of that error message? I often have linking problems and I have to pass the parameters to gcc by hand using -L and -l

GetFree
A: 

Everything seem to work fine now. Thank you.
I hope no more problems appear.

Just one more thing. Now I get a warning when I compile:

/usr/bin/ld: warning: libstdc++.so.5, needed by /usr/local/lib/libboost_serialization-gcc33-mt-1_35.so, may conflict with libstdc++.so.6

should I worry about that? If so, how can I solve it?

GetFree
You should if you use any of the Boost shared libraries. To fix this, recompile Boost with the new GCC. However - it seems to me that your GCC installations are somewhat intersecting. Did you compile them yourself? If not, check your distribution's docs on using multiple GCC versions. If yes, oops.
Mihai Limbășan