在嵌入式开发中,碰到一个问题,arm-v7-linux-uclibceabi-gcc编译工具在路径中,但不能运行。用file看了一下发现居然是32bit的应用,程序,而安装的ubuntu是64bit的。
$ file arm-v7-linux-uclibceabi-gcc
arm-v7-linux-uclibceabi-gcc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=155512229a6a8c0b9940242fffb3e85fe9e956a6, not stripped
查看ubuntu的信息:
$ file /lib/systemd/systemd
/lib/systemd/systemd: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=36002c7ee605e4fa995d6e895b318cd2eaf2240a, stripped
解决方法,安装32bit的兼容库
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install libc6:i386 libstdc++6:i386
libncurses5:i386 zlib1g:i386
网友评论