问题描述
我昨天安装了Ubuntu 14.04(Trusty Tahr).一切似乎都还可以.但是,当我尝试编译一些C代码时,遇到以下错误.该错误似乎是由于操作系统缺少32位体系结构支持所致.错误输出如下:
I installed Ubuntu 14.04 (Trusty Tahr) yesterday. Everything seems OK. But when I tried to compile some C code, I encounter the following error. The error seems to be due to the OS lacking the 32-bit architecture support. The error output is as following:
/usr/bin/ld: i386 architecture of input file `./libsc.a(ftl_msg.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `./libsc.a(libsc_debug.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `./libsc.a(libsc_str.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `./libsc.a(libsc_cfg_common.o)' is incompatible with i386:x86-64 output
当我使用Ubuntu 12.04(精确的穿山甲)时,我曾经习惯使用apt-get install ia32-libs
.但是我知道的是,自Ubuntu 13.10(Saucy Salamander)起,Ubuntu删除了ia32-libs.我该如何解决这个问题?
I used to apt-get install ia32-libs
when I was using Ubuntu 12.04 (Precise Pangolin). But what I know is that Ubuntu has removed the ia32-libs since Ubuntu 13.10 (Saucy Salamander). How can I fix this problem?
推荐答案
您可以尝试安装32位库(不是全部在ia32-libs中):
You can try this to install the 32-bit library (not all in ia32-libs):
sudo apt-get install program:i386
sudo dpkg --add-architecture i386
可能是必需的(如果您从未运行过).
sudo dpkg --add-architecture i386
may be required (if you haven't ever run that).
或者,如果您想安装整个ia32-lib,请尝试以下顺序:
Or if you want to install the whole ia32-lib instead, try the following order:
sudo -i
cd /etc/apt/sources.list.d
echo "deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted universe multiverse" >ia32-libs-raring.list
apt-get update
apt-get install ia32-libs
PS:通过这种方式,您可以安装ia32-libs
.但是,我们改为添加源代码13.04,因此,可能存在一些未知问题.安装ia32-libs
后,建议您删除/etc/apt/sources.list.d
中的ia32-libs-raring.list
,然后执行sudo apt-get update
.
PS: In this way, you can install ia32-libs
. However, we add the source of 13.04 instead, so, there may be some unknown problem. After installing ia32-libs
, I recommend you to remove the ia32-libs-raring.list
in /etc/apt/sources.list.d
, and do sudo apt-get update
.
如果要修复Android SDK的依赖性,可以尝试以下操作:
If you want to fix the dependency of Android SDK, you can try this bellow:
sudo apt-get install -y libc6-i386 lib32stdc++6 lib32gcc1 lib32ncurses5 lib32z1
这篇关于如何在Ubuntu 14.04 LTS(Trusty Tahr)中安装ia32-libs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!