wsl下安装交叉编译问题解决

因为我的交叉编译工具是32位的,所以win10下的wsl没法使用

使用如下命令

 arm-none-linux-gnueabi-gcc -v

会出现下面的告警

-bash: /usr/local/arm/arm-2014.05/bin/arm-none-linux-gnueabi-gcc: cannot execute binary file: Exec format error

除了要安装一些支持的库之外,还需要下面的设置

sudo apt update
sudo apt install qemu-user-static
sudo update-binfmts --install i386 /usr/bin/qemu-i386-static --magic '\x7fELF\x01\x01\x01\x03\x00\x00\x00\x00\x00\x00\x00\x00\x03\x00\x03\x00\x01\x00\x00\x00' --mask '\xff\xff\xff\xff\xff\xff\xff\xfc\xff\xff\xff\xff\xff\xff\xff\xff\xf8\xff\xff\xff\xff\xff\xff\xff'

常见的库如下

sudo apt-get install lsb-core lib32stdc++6
sudo apt-get install lib32ncurses5 ​lib32ncurses5-dev
sudo apt-get install lib32z1

猜你喜欢

转载自blog.csdn.net/qq_16777851/article/details/106293307