安装交叉编译器就下载相应的交叉编译器:
交叉编译器下载地址:http://archive.openwrt.org/barrier_breaker/14.07/ramips/mt7620a/

直接拖拉到Ubuntu中,然后直接解压tar -jxvf OpenWrt-Toolchain-ramips-for-mipsel_24kec+dsp-gcc-4.8-linaro_uClibc-0.9.33.2.tar.bz2,如下:

然后添加文件变量
export PATH=$PATH:/project/widora/OpenWrt-Toolchain-ramips-for-mipsel_24kec+dsp-gcc-4.8-linaro_uClibc-0.9.33.2/toolchain-mipsel_24kec+dsp_gcc-4.8-linaro_uClibc-0.9.33.2/bin
export STAGING_DIR=/project/widora/OpenWrt-Toolchain-ramips-for-mipsel_24kec+dsp-gcc-4.8-linaro_uClibc-0.9.33.2

保存,激活变量
source /root/.bashrc
最好重新启动下你的客户端。
然后检测是否安装成功
echo $PATH

可以看到已经出现了。
然后写个hello,验证下
hello就不贴出来了。
直接编译 mipsel-openwrt-linux-gcc hello.c -o hello

然后把可执行文件搞到板子里
运行./hello

证明交叉编译器的编译的程序在板卡上可以运行。交叉编译器安装成功。
本文详细介绍了如何在Ubuntu环境下安装并配置OpenWrt交叉编译器,包括下载、解压、环境变量设置及验证步骤,确保交叉编译器能够成功编译并在目标板上运行程序。

被折叠的 条评论
为什么被折叠?



