参考链接:
https://copyfuture.com/blogs-details/20210727171910143a
https://blog.csdn.net/qq_47346664/article/details/119908775
现象:
../../../bin/llvm-tblgen: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.26' not found (required by ../../../bin/llvm-tblgen)
../../../bin/llvm-tblgen: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ../../../bin/llvm-tblgen)
../../../bin/llvm-tblgen: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ../../../bin/llvm-tblgen)
../../../bin/llvm-tblgen: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by ../../../bin/llvm-tblgen)
问题分析
可见libstdc++.so.6动态库中并没有包含GLIBCXX_3.4.26符号,所以找不到。
其实在编译gcc的时候,对应的libstdc++.so已经生成了,切换到gcc目录,使用find ./ -name "libstdc++.so.*"即可找到
解决:
步骤一:将下载的包放到 /usr/lib64 下
cp libstdc++.so.6.0.26 /usr/lib64/
步骤二: 到 /usr/lib64 目录下
cd /usr/lib64/
步骤三:删除现在的libstdc++.so.6
rm -rf libstdc++.so.6
步骤四:重新建立链接
ln -s libstdc++.so.6.0.26 libstdc++.so.6