欢迎来到尧图网

客户服务 关于我们

您的位置:首页 > 文旅 > 游戏 > GDB:wrong library or version mismatch?

GDB:wrong library or version mismatch?

2025/12/2 23:02:49 来源:https://blog.csdn.net/RandyLeonard/article/details/141216629  浏览:    关键词:GDB:wrong library or version mismatch?

实际项目中,常常会遇到程序运行环境与本地环境不一致的情况。一般GBG会报如下错误:
warning: .dynamic section for "/lib64/librt.so.1" is not at the expected address (wrong library or version mismatch?)
。。。。。。
Do you need "set solib-search-path" or "set sysroot"?

上述错误提示意思是库错误或者库的版本不匹配。实际看下库版本

运行环境
lrwxrwxrwx 1 root root 15  8月 14 13:28 /lib64/librt.so.1 -> librt-2.11.3.so
本地环境
lrwxrwxrwx 1 root root 15 Oct 15  2020 /lib64/librt.so.1 -> librt-2.11.1.so

解决方法:

需要搭建与程序运行环境一致的环境(装一个和运行环境操作系统版本一样的系统),保证操作系统及glibc版本一致。

GNU gdb (GDB) 7.8.2
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-unknown-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from gbsg...done.
[New LWP 5128]
[New LWP 5129]
[New LWP 5106]
[New LWP 5103]
[New LWP 5108]
[New LWP 5107]
[New LWP 5116]
[New LWP 5117]
[New LWP 5112]
[New LWP 5121]
[New LWP 5111]
[New LWP 5126]
[New LWP 5120]
[New LWP 5114]
[New LWP 5118]
[New LWP 5113]
[New LWP 5119]
[New LWP 5124]
[New LWP 5125]
[New LWP 5105]
[New LWP 5123]
[New LWP 5109]
[New LWP 5115]
[New LWP 5127]
[New LWP 5110]
[New LWP 5122]
[New LWP 5104]warning: .dynamic section for "/lib64/librt.so.1" is not at the expected address (wrong library or version mismatch?)warning: .dynamic section for "/lib64/libcrypt.so.1" is not at the expected address (wrong library or version mismatch?)warning: .dynamic section for "/lib64/libpthread.so.0" is not at the expected address (wrong library or version mismatch?)warning: .dynamic section for "/lib64/libdl.so.2" is not at the expected address (wrong library or version mismatch?)warning: .dynamic section for "/lib64/libz.so.1" is not at the expected address (wrong library or version mismatch?)warning: .dynamic section for "/lib64/libm.so.6" is not at the expected address (wrong library or version mismatch?)warning: .dynamic section for "/lib64/ld-linux-x86-64.so.2" is not at the expected address (wrong library or version mismatch?)warning: .dynamic section for "/lib64/libnss_files.so.2" is not at the expected address (wrong library or version mismatch?)warning: Could not load shared library symbols for /lib64/libgcc_s.so.1.
Do you need "set solib-search-path" or "set sysroot"?

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

热搜词