MySQL++ 升级 GCC 后库无法工作

发布于 2024-07-07 04:24:00 字数 453 浏览 7 评论 0原文

我正在使用 mysql++ 库并使用 GCC 3.3.4 进行编译。
那个 GCC 版本有一些错误,所以我升级到 GCC 3.4.6。
升级 GCC 后,我重建了 mysql++ 并重新编译了我的程序。 但现在我收到分段错误错误。

我收到以下消息:

./mysqlTest:符号“_ZTVSt15basic_stringbufIcSt11char_traitsIcESaIcEE” 共享对象的大小不同,请考虑重新链接。
分段错误

有什么我必须重建、重新链接或其他什么才能让我的应用程序再次工作吗?
mysql C API 怎么样? mysql++ 是它的包装器。
应该重建 mysql C API 还是什么?

请帮忙,我不知道该怎么办。 我需要让这个工作成功。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

橙幽之幻 2024-07-14 04:24:00

将 C++ 标准库从 GCC 3.3 升级到 GCC 3.4 后,如果您的程序使用链接到它的所有库,并且同时还直接链接到标准 C++ 库,则您必须重新编译它们。 在您的情况下,考虑到您的后续操作,libdb_cxx-4.2 出现了错误,因此请重建 Berkeley DB 4.2。 基本上,mysqlTest 链接到新的 C++ 标准库和 Berkeley DB,但 Berkeley DB 链接到旧的标准库。 链接器将从两个库中提取符号,但其中一些库的内联存储类可能会发生变化,并且 Berkeley DB 会感到困惑。

要检查您使用的库,请针对您的二进制文件运行 ldd,然后针对列表中的每个 C++ 库运行 ldd

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.

善良天后 2024-07-14 04:24:00

在重建 mysql++ 之前你有没有“make clean”?

似乎 mysqlTest 程序没有重新编译,并且仍然需要以前的库。

如果您确实进行了 make clean(假设 mysqlTest 是软件包中的一个程序),那么您在安装新库后是否进行了“ldconfig”?

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?

_畞蕅 2024-07-14 04:24:00

是的,我在重建之前做了“清理”。
mysqlTest 是我的一个程序。 我仍然保留着升级 GCC 之前编译的版本,并且运行良好。 但是我升级后编译的却出现了这个错误。

我也做了 ldconfig,并收到以下消息:

ldconfig: /usr/lib/libdb_cxx-4.2.so 不是符号链接

我不知道这是否只是一个警告,或者是否意味着进程被中断。

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.

清引 2024-07-14 04:24:00

回复 moocha:

我重建了我的应用程序正在使用的其他一些东西,并且我设法制作了一个简单的程序来工作。

不过,我仍然遇到一些复杂程序的问题,我正在尝试解决这些问题。

我很确定 libdb_cxx-4.2.so 不是问题,因为我记得不久前我运行 ldconfig 时看到了该消息。
即便如此,我怎样才能摆脱这个错误消息呢? 我经常遇到链接问题,我必须使用 -L 和 -l 手动将参数传递给 gcc

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文