Home » 华清嵌入式 » wsl下安装交叉编译问题解决

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

编 辑:Y ┊ 时 间:2022年03月06日 ┊ 访问: 19 次

打不开wsl

WSL2 ERROR: 0x800701bc

 run wsl --update --status in powershell
 run wsl.exe --update in powershell

无法编译的问题

因为我的交叉编译工具是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

或者出现:

arm-none-linux-gnueabi-gcc No such file or directory

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

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




Copyright © 2026 Y 版权所有.网站运行:13年238天21小时25分