- Ubuntu14.04上运行程序出现如下错误:
运行 ./program
no such file 提示没有那个文件或目录
分析:程序为32位程序,uname –m查看系统为x86_64,64位系统,不兼容。 - 安装ia32-libs解决兼容性问题:
sudo apt-get install ia32-libs
Package ia32-libs is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
lib32z1 lib32ncurses5 lib32bz2-1.0
E: Package 'ia32-libs' has no installation candidate
分别安装了lib32z1 lib32ncurses5 lib32bz2-1.0
- 运行./program 出现错误:
error while loading shared libraries: libmysqlclient.so.18: wrong ELF class: ELFCLASS64
查询:在64位linux系统运行其它的32位二进制文件时,都会出现“wrong ELF class: ELFCLASS64”这个错误提示。
还是兼容性问题,需要ia32-libs。但是从ubuntu 13.10已经废弃了ia32-libs。
4. 实验如下方法:
sudo apt-get install libc6:i386
sudo -i
cd /etc/apt/sources.list.d
echo "deb http://archive.ubuntu.com/ubuntu/ raring main restricted universe multiverse" >ia32-libs-raring.list
apt-get update
apt-get install ia32-libs
rm /ia32-libs-raring.list
apt-get update
exit
sudo apt-get install gcc-multilib
编译时gcc编译的时候需要添加-m32
参数
仍然存在问题,安装ia32-libs失败。