1.安装交叉编译工具:arm-linux-gcc 安装包4.4.6_TQ210_release_20120720.tar.bz2
环境:ubuntu 20.版,已换清华源
1.1解压文件
提取解压1.1.6到home目录
1.2配置环境
打开文件vim ~/.bashrc(要安装vim)
加入
vi /home/hjh2/.bashrc
export PATH="$PATH:/home/hjh2/4.4.6/bin"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/hjh2/4.4.6/lib
在/etc/profile中追加
sudo vim /etc/profile
export PATH="$PATH:/home/hjh2/4.4.6/bin"
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/hjh2/4.4.6/lib
source /home/hjh2/.bashrc
Source /etc/profile
我在这里卡了很久都没由找到答案,一直提醒提示:no such file or directory,最后发现是路径错了,网上的人的路径是/usr/谁谁谁用户/4.4.6/bin,他的主目录是usr 而我的是home,没注意就错了
提示:no such file or directory表示64位ubuntu不能识别32位编译器,需要安装一个32位的兼容库:lib32ncurses5-dev lib32z1。
安装
重启 测试echo $PATH
arm-linux-gcc -v