Ubuntu18.04.3中安装交叉编译环境
发布日期:2021-05-07 02:33:33 浏览次数:31 分类:精选文章

本文共 1134 字,大约阅读时间需要 3 分钟。

Ubuntu18.04.3中安装交叉编译环境

基于智龙嵌入式开发板做的一个项目,在按照孙冬梅老师教程搭建环境时候遇到的问题。借此为了方便自己回顾,也为了白piao那么多后有所输出。谢谢大佬跳过。

  • 环境:Ubuntu18.04.3
  • 交叉编译工具:gcc-4.3-ls232
  • 工具下载地址:

安装步骤:

  • 解压缩交叉编译工具到 /opt 下:
tar zxvf gcc-4.3-ls232.tar.gz -C /opt
  • 指定编译路径,添加环境变量,打开.bashrc文件
vi ~/.bashrc
  • 在其末尾添加
export PATH=/opt/gcc-4.3-ls232/bin:$PATH
  • 重新加载路径
source ~/.bashrc
  • 在此正常安装完毕,可以执行 mipsel-linux-gcc -v ,出现以下提示即安装成功
root@ubuntu:/# mipsel-linux-gcc -vUsing built-in specs.Target: mipsel-linuxConfigured with: ../gcc-4.3.0/configure --prefix=/opt/gcc-4.3-ls232 --host=i486-pc-linux-gnu --build=i486-pc-linux-gnu --target=mipsel-linux --host=i486-pc-linux-gnu --with-sysroot=/opt/gcc-4.3-ls232/sysroot --with-abi=32 --disable-nls --enable-shared --disable-multilib --enable-__cxa_atexit --enable-c99 --enable-long-long --enable-threads=posix --enable-languages=c,c++,fortran --enable-poison-system-directoriesThread model: posixgcc version 4.3.0 (GCC)

其他问题

  • 执行 mipsel-linux-gcc -v ,提示 No such file or directory。先执行
which mipsel-linux-gcc

如果可以找到文件,说明环境变量没有问题。原因是计算机上安装的是 64 位的操作系统,但是交叉工具链是 32 位的,出现兼容问题,安装32 位共享库之后,能解决绝大部分兼容性问题。

apt-get install lsb-coreapt-get install lib32z1 lib32ncurses5
上一篇:Win10、虚拟机Ubuntu和智龙开发板ping通
下一篇:数据结构第七章(图---总结一)

发表评论

最新留言

哈哈,博客排版真的漂亮呢~
[***.90.31.176]2025年04月01日 03时45分36秒