出现错误:
undefined reference to `dladdr@GLIBC_2.34`
原因:
系统的GLIBC的版本比较低
验证方法:
ldd --version 查看GLIBC的版本
解决方法:
升级GLIBC,参考:Ubuntu20.04更新GLIBC到2.35版本
运行的命令如下:
在/etc/apt/sources.list文件末尾增加:deb http://mirrors.aliyun.com/ubuntu/ jammy main
sudo apt update
sudo apt install libc6
这里会提示:
┌───────────────────────────────────────────┤ Configuring libc6
│ There are services installed on your system which need to be restarted when certain libraries, such as
│ libpam, libc, and libssl, are upgraded. Since these restarts may cause interruptions of service for the
│ system, you will normally be prompted on each upgrade for the list of services you wish to restart. You
│ can choose this option to avoid being prompted; instead, all necessary restarts will be done for you
│ automatically so you can avoid being asked questions on each library upgrade.
│
│ Restart services during package upgrades without asking?
│
│
重启是否需要提示,我选No
然今继续,后面有个提示不用改,OK
安装完后运行,sudo apt --fix-broken install
把之前的依赖关系重新整理下。
sudo ldconfig
然后ldd --version再查看下版本是否升级好了
上面只是安装了C库,C++库没有更新,
g++ --version
ld --version
查看相关的版本是否更新
如果还出现
`std::__exception_ptr::exception_ptr::_M_release()@CXXABI_1.3.13'
运行 strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep CXXABI
检查有没有对应的版本的ABI,没有的话安装升级C++标准库:
sudo apt install libstdc++6