您的位置:首页 > 运维架构 > Linux

64位Ubuntu下使用arm-linux-gcc交叉编译器

2016-11-21 14:11 573 查看
arm-linux-gcc是用于交叉编译ARM平台上Linux程序的编译器,在32位的宿主Linux计算机上运行时是正常的,但是在我的64位Linux发行版Ubuntu系统上却无法运行,报错:/usr/local/arm/4.3.3/bin/arm-linux-gcc: 3: /usr/local/arm/4.3.3/bin/arm-linux-gcc: arm-none-linux-gnueabi-gcc: not found

我寻思之前在32位的Ubuntu系统上是正常运行的,怎么在64位Ubuntu上就不能运行呢,我又猜了一下可能的原因:64位系统没有32位系统的库,所以需要安装32位兼容库:

sudo apt-get install ia32-libs但是安装的时候出现下面的提示:
root@ubuntu:/mnt/hgfs/vmshare/examples/leds# apt-get install ia32-libs
Reading package lists... Done
Building dependency tree
Reading state information... Done
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:
lib32ncurses5 lib32z1

E: Package 'ia32-libs' has no installation candidate
根据提示就安装了lib32ncurses5和lib32z1库,安装完毕之后再次运行arm-linux-gcc就可以运行了:
root@ubuntu:/mnt/hgfs/vmshare/examples/leds# make
arm-linux-gcc -o led led.c
root@ubuntu:/mnt/hgfs/vmshare/examples/leds# ls
led led.c Makefile
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: