- 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失敗。