How to install ia32-libs in Ubuntu 14.04 LTS

转自StackFlow

http://stackoverflow.com/questions/23182765/how-to-install-ia32-libs-in-ubuntu-14-04-lts-trusty-tahr



问题描述:

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
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?


问题解决:


I got it finally! Here is my way, and I hope it can help you :)


sudo apt-get install libc6:i386
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
rm /etc/apt/sources.list.d/ia32-libs-raring.list
apt-get update
exit
sudo apt-get install gcc-multilib
I don't know the reason why I need to install these, but it works on my computer. When you finish installing these packages, it's time to try. Oh yes, I need to tell you. This time when you want to compile your code, you should add -m32 after gcc, for example: gcc -m32 -o hello helloworld.c. Just make clean and make again. Good luck friends.


PS: my environment is: Ubuntu 14.04 64-bit (Trusty Tahr) and GCC version 4.8.4. I have written the solution in my blog, but it is in Chinese :-) - How to compass 32bit programm under ubuntu14.04.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值