/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21‘ not found (required by

在某项目中遇到下面的错误,

cpp 复制代码
./model2trt_v2: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./model2trt_v2)
./model2trt_v2: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ../../../lib/linux_lib/libcuda_utils.so)
./model2trt_v2: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ../../../lib/linux_lib/libprotobuf.so.24)
./model2trt_v2: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by ../../../lib/linux_lib/libprotobuf.so.24)
./model2trt_v2: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by ../../../lib/linux_lib/libopencv_core.so.4.4)
./model2trt_v2: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ../../../lib/linux_lib/libopencv_core.so.4.4)
./model2trt_v2: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ../../../lib/linux_lib/libopencv_highgui.so.4.4)
./model2trt_v2: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ../../../lib/linux_lib/libopencv_imgproc.so.4.4)
./model2trt_v2: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by ../../../lib/linux_lib/libopencv_imgproc.so.4.4)
./model2trt_v2: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ../../../lib/linux_lib/libopencv_imgcodecs.so.4.4)
./model2trt_v2: /lib64/libstdc++.so.6: version `CXXABI_1.3.8' not found (required by ../../../lib/linux_lib/libopencv_imgcodecs.so.4.4)

然后看了下g++版本是8.5.0

出现上述错误的原因是安装了高版本的GCC之后没有更新软连接,只需要查找安装GCC时生成的最新动态库,然后添加软连接即可。

bash 复制代码
find / -name "libstdc++.so*" 

得到如下结果

bash 复制代码
/usr/lib/gcc/x86_64-redhat-linux/4.8.2/32/libstdc++.so
/usr/lib/gcc/x86_64-redhat-linux/4.8.2/libstdc++.so
/usr/lib64/libstdc++.so.6
/usr/lib64/libstdc++.so.6.0.19-bak
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.19-gdb.py
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.19-gdb.pyc
/usr/share/gdb/auto-load/usr/lib64/libstdc++.so.6.0.19-gdb.pyo
/usr/local/lib64/libstdc++.so.6.0.25
/usr/local/lib64/libstdc++.so.6
/usr/local/lib64/libstdc++.so
/usr/local/lib64/libstdc++.so.6.0.25-gdb.py
/usr/local/cuda-11.4/nsight-systems-2021.2.4/target-linux-armv8/host-linux-armv8/libstdc++.so.6
/usr/local/cuda-11.4/nsight-systems-2021.2.4/host-linux-x64/libstdc++.so.6
/usr/local/cuda-10.2/nsight-systems-2019.5.2/host-linux-x64/libstdc++.so.6
/usr/local/cuda-11.7/nsight-compute-2022.2.0/host/linux-desktop-glibc_2_11_3-x64/libstdc++.so.6
/usr/local/cuda-11.7/nsight-systems-2022.1.3/host-linux-x64/libstdc++.so.6
/opt/software/gcc/gcc-8.5.0/output/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.25
/opt/software/gcc/gcc-8.5.0/output/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6
/opt/software/gcc/gcc-8.5.0/output/prev-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so
/opt/software/gcc/gcc-8.5.0/output/stage1-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.25
/opt/software/gcc/gcc-8.5.0/output/stage1-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6
/opt/software/gcc/gcc-8.5.0/output/stage1-x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so
/opt/software/gcc/gcc-8.5.0/output/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6.0.25
/opt/software/gcc/gcc-8.5.0/output/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so.6
/opt/software/gcc/gcc-8.5.0/output/x86_64-pc-linux-gnu/libstdc++-v3/src/.libs/libstdc++.so

然后我看了下/usr/lib64/libstdc++.so.6是链接到哪里去了,

同时也可以看到在/usr/local/lib64里面有libstdc++.so.6.0.25的,所以我进行了如下操作:

bash 复制代码
cp /usr/local/lib64/libstdc++.so.6.0.25  /usr/lib64
cd /usr/lib64
ln -snf libstdc++.so.6.0.25 libstdc++.so.6

这个问题其实我之前遇到过,之前的博客笔记。

/usr/lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by_node: /lib64/libstdc++.so.6: version `glibcxx_3.4.-CSDN博客

相关推荐
筱源源8 分钟前
Kafka-linux环境部署
linux·kafka
算法与编程之美1 小时前
文件的写入与读取
linux·运维·服务器
xianwu5431 小时前
反向代理模块
linux·开发语言·网络·git
Amelio_Ming1 小时前
Permissions 0755 for ‘/etc/ssh/ssh_host_rsa_key‘ are too open.问题解决
linux·运维·ssh
Ven%2 小时前
centos查看硬盘资源使用情况命令大全
linux·运维·centos
TeYiToKu3 小时前
笔记整理—linux驱动开发部分(9)framebuffer驱动框架
linux·c语言·arm开发·驱动开发·笔记·嵌入式硬件·arm
dsywws3 小时前
Linux学习笔记之时间日期和查找和解压缩指令
linux·笔记·学习
yeyuningzi3 小时前
Debian 12环境里部署nginx步骤记录
linux·运维·服务器
上辈子杀猪这辈子学IT3 小时前
【Zookeeper集群搭建】安装zookeeper、zookeeper集群配置、zookeeper启动与关闭、zookeeper的shell命令操作
linux·hadoop·zookeeper·centos·debian
minihuabei3 小时前
linux centos 安装redis
linux·redis·centos