C++ 加载共享库时出错:libstdc++.so.6:错误的 ELF 类:ELFCLASS64
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3967661/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
error while loading shared libraries: libstdc++.so.6: wrong ELF class: ELFCLASS64
提问by Christian Abella
I am trying to install Qt in my CentOS system. While building the library, I'm getting this error:
我正在尝试在我的 CentOS 系统中安装 Qt。在构建库时,我收到此错误:
/root/capture/qt-everywhere-opensource-src-4.7.0/bin/qmake: error while loading shared libraries: libstdc++.so.6: wrong ELF class: ELFCLASS64
/root/capture/qt-everywhere-opensource-src-4.7.0/bin/qmake: error while loading shared libraries: libstdc++.so.6: wrong ELF class: ELFCLASS64
采纳答案by Christian Abella
It seems the softlink of the libstdc++.so.6
has been changed and is pointing to libstdc++.so.6.0.13
(64-bit?). I just changed the softlink by issuing the following command (in /usr/lib
folder):
似乎软链接libstdc++.so.6
已更改并指向libstdc++.so.6.0.13
(64位?)。我只是通过发出以下命令(在/usr/lib
文件夹中)更改了软链接:
rm -f libstdc++.so.6
ln -s ./libstdc++.so.6.0.8 ./libstdc++.so.6
回答by mwm
I was having this problem running binaries compiled with g++ under a 64bit ubuntu 14.04 installation.
我在 64 位 ubuntu 14.04 安装下运行用 g++ 编译的二进制文件时遇到了这个问题。
I installed g++-multilib and everything runs fine now
我安装了 g++-multilib,现在一切正常
sudo apt-get install g++-multilib
回答by Arcsoftech
yum reinstall $(rpm -qa)
The above command will resolve all the issue in centos.
以上命令将解决centos中的所有问题。