编程语言
首页 > 编程语言> > ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20‘ not found

ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20‘ not found

作者:互联网

ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20’ not found

** 适用于在远程服务器跑代码报错的情况下 **

1.查找编译gcc时生成的动态库

find / -name "libstdc++.so*"

2.如果你使用服务器将会看到一大堆的库

/home/hyd/yzq/xiehaotao/FALdetector-master/libstdc++.so.6
/home/hyd/libstdc++.so.6
/home/hyd/anaconda3/pkgs/libstdcxx-ng-9.1.0-hdf63c60_0/lib/libstdc++.so.6
/home/hyd/anaconda3/pkgs/libstdcxx-ng-9.1.0-hdf63c60_0/lib/libstdc++.so.6.0.26
/home/hyd/anaconda3/pkgs/libstdcxx-ng-9.1.0-hdf63c60_0/lib/libstdc++.so
/home/hyd/anaconda3/pkgs/libstdcxx-ng-9.1.0-hdf63c60_0/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6
/home/hyd/anaconda3/pkgs/libstdcxx-ng-9.1.0-hdf63c60_0/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so.6.0.26
/home/hyd/anaconda3/pkgs/libstdcxx-ng-9.1.0-hdf63c60_0/x86_64-conda_cos6-linux-gnu/sysroot/lib/libstdc++.so
/home/hyd/anaconda3/pkgs/libgcc-7.2.0-h69d50b8_2/lib/libstdc++.so.6.0.21
/home/hyd/anaconda3/pkgs/libstdcxx-ng-11.1.0-h56837e0_8/lib/libstdc++.so.6.0.29
/home/hyd/anaconda3/pkgs/libstdcxx-ng-11.1.0-h56837e0_8/lib/libstdc++.so.6
/home/hyd/anaconda3/pkgs/libstdcxx-ng-11.1.0-h56837e0_8/lib/libstdc++.so
/home/hyd/anaconda3/pkgs/libstdcxx-ng-9.3.0-hd4cf53a_17/lib/libstdc++.so
/home/hyd/anaconda3/pkgs/libstdcxx-ng-9.3.0-hd4cf53a_17/lib/libstdc++.so.6.0.28
/home/hyd/anaconda3/pkgs/libstdcxx-ng-9.3.0-hd4cf53a_17/lib/libstdc++.so.6

3.从中选择一个比较高级的版本查看他的动态库

strings /home/hyd/anaconda3/lib/libstdc++.so.6.0.26 | grep GLIBC
GLIBCXX_3.4
GLIBCXX_3.4.1
GLIBCXX_3.4.2
GLIBCXX_3.4.3
GLIBCXX_3.4.4
GLIBCXX_3.4.5
GLIBCXX_3.4.6
GLIBCXX_3.4.7
GLIBCXX_3.4.8
GLIBCXX_3.4.9
GLIBCXX_3.4.10
GLIBCXX_3.4.11
GLIBCXX_3.4.12
GLIBCXX_3.4.13
GLIBCXX_3.4.14
GLIBCXX_3.4.15
GLIBCXX_3.4.16
GLIBCXX_3.4.17
GLIBCXX_3.4.18
GLIBCXX_3.4.19
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
GLIBCXX_3.4.23
GLIBCXX_3.4.24
GLIBCXX_3.4.25
GLIBCXX_3.4.26
GLIBC_2.2.5
GLIBC_2.3
GLIBC_2.6
GLIBC_2.4
GLIBC_2.3.2
GLIBCXX_DEBUG_MESSAGE_LENGTH

4.将上面的最新动态库/home/hyd/anaconda3/lib/libstdc++.so.6.0.26复制到我们想要跑的项目的目录下/home/hyd/yzq/xiehaotao/FALdetector-master:

cp /home/hyd/anaconda3/lib/libstdc++.so.6.0.26 /home/hyd/yzq/xiehaotao/FALdetector-master/

标签:GLIBCXX,libstd,hyd,c++,3.4,home,20
来源: https://blog.csdn.net/mo_heng/article/details/120316007