1. libstdc++.so.6: version 'CXXABI_' not found
具体报错:
./a.out: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by ./a.out)
./a.out: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./a.out)
- 原因:
查看命令:strings /usr/lib64/libstdc++.so.6 | grep CXXABI
虚拟机中升级了GCC到10.3.0,但是user/lib64下面的libstdc++.so.6指向的还是原来的版本, /usr/lib64/libstdc++.so.6 -> libstdc++.so.6.0.19 - 修改方法:
替换成最新的so
cp /usr/local/lib64/libstdc++.so.6.0.28 /usr/lib64/
rm -rf libstdc++.so.6
ln -s libstdc++.so.6.0.28 libstdc++.so.6
参考:https://blog.csdn.net/u012811841/article/details/77854581
2. boost库编译install后,执行可执行文件没找到对应的库
使用ldd -r 查看
export LD_LIBRARY_PATH=/usr/local/lib