当前位置: 首页 > 工具软件 > GNU Ada > 使用案例 >

Ubuntu下进行交叉编译时报错:arm-arago-linux-gnueabi-gcc: No such file or directory

林丁雷
2023-12-01

一、问题描述。

在64位Ubuntu下进行交叉编译时报错“arm-arago-linux-gnueabi-gcc: No such file or directory”。

arm-arago-linux-gnueabi-gcc: No such file or directory
arm-arago-linux-gnueabi-g++: No such file or directory

二、问题分析。

此gcc可执行文件是32位版本,而在64位系统上运行需要安装32位兼容包才可能正常运行。

用file命令查看这个文件如下:

ms@ubuntu:~$ file ./bin/arm-arago-linux-gnueabi-gcc
bin/arm-arago-linux-gnueabi-gcc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.2.5, with debug_info, not stripped
ms@ubuntu:~$ file ./bin/arm-arago-linux-gnueabi-g++
bin/arm-arago-linux-gnueabi-g++: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.2.5, with debug_info, not stripped
ms@ubuntu:~$

三、解决办法。

1、安装32位的依赖库ia32-libs,安装此库文件后,问题解决。

sudo apt-get install ia32-libs -y

2、在ubuntu13.04版本之后,ia32-libs库文件已经被弃用,替代安装包为lib32z1、lib32ncurses5或lib32ncurses6,安装其一便可解决问题。

3、安装依赖库返回信息如下所示。

sudo apt-get install lib32z1 -y

ms@ubuntu:~$ sudo apt-get install lib32z1 -y
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following package was automatically installed and is no longer required:
  libfprint-2-tod1
Use 'sudo apt autoremove' to remove it.
The following additional packages will be installed:
  libc6-i386
The following NEW packages will be installed:
  lib32z1 libc6-i386
0 upgraded, 2 newly installed, 0 to remove and 0 not upgraded.
Need to get 2,778 kB of archives.
After this operation, 14.9 MB of additional disk space will be used.
Get:1 http://mirrors.aliyun.com/ubuntu focal-updates/main amd64 libc6-i386 amd64 2.31-0ubuntu9.1 [2,721 kB]
Get:2 http://mirrors.aliyun.com/ubuntu focal-updates/main amd64 lib32z1 amd64 1:1.2.11.dfsg-2ubuntu1.1 [56.5 kB]
Fetched 2,778 kB in 0s (5,683 kB/s)
Selecting previously unselected package libc6-i386.
(Reading database ... 184878 files and directories currently installed.)
Preparing to unpack .../libc6-i386_2.31-0ubuntu9.1_amd64.deb ...
Unpacking libc6-i386 (2.31-0ubuntu9.1) ...
Selecting previously unselected package lib32z1.
Preparing to unpack .../lib32z1_1%3a1.2.11.dfsg-2ubuntu1.1_amd64.deb ...
Unpacking lib32z1 (1:1.2.11.dfsg-2ubuntu1.1) ...
Setting up libc6-i386 (2.31-0ubuntu9.1) ...
Setting up lib32z1 (1:1.2.11.dfsg-2ubuntu1.1) ...
Processing triggers for libc-bin (2.31-0ubuntu9.1) ...
ms@ubuntu:~$ 

 类似资料: