一、安装ARM-Linux-GCC工具链

  只需要一句命令:

  sudo apt-get install gcc-arm-linux-gnueabi

  前提是你的Ubuntu系统版本是官网支持的最新的版本,若不是,请升级。执行以上命令即可。

二、使用工具链

  注意!这里不能使用 gcc 命令来召唤它。它的名字是 arm-linux-gnueabi-gcc 。如果出现 Command Not Found,请关闭Terminal,再重新打开。再不行,就变成超级用户,把它添加到 PATH 中。

  Tips:查看安装位置。

     首先你要取得超级用户权限(临时取得权限可用命令:sudo -i)

root@ql-virtual-machine:~# locate arm-linux-gnueabi-gcc
/usr/bin/arm-linux-gnueabi-gcc
/usr/bin/arm-linux-gnueabi-gcc-4.6
/usr/share/man/man1/arm-linux-gnueabi-gcc-4.6..gz
/usr/share/man/man1/arm-linux-gnueabi-gcc..gz

参考资料:

其一,来自Stackoverflow,关于在Ubuntu或者Window安装ARM工具链的回答。

For ARM-Linux application development the preferable choice is a Linux Host(x86) machine with a ARM toolchain installed in it. In Ubuntu Desktop machine you can use the following command to install ARM toolchain:

翻译:对于ARM-Linux应用开发,最好的选择是安装了ARM工具链的x86 Linux主机。在Ubuntu桌面电脑中,你可以使用下面的命令安装ARM工具链。

apt-get install gcc-arm-linux-gnueabi

After toolchain installation you can use the following command for cross compilation:

翻译:安装完工具链后,你要用下面的命令进行交叉编译:

gcc-arm-linux-gnueabi-gcc -o hello hello.c

Using this toolchain you can cross-compile your C program using Standard C library without the need of startup code. Applications can be cross-compiled at your Host Linux(x86) platform and run on Target Linux(ARM) platform.

Windows version of ARM-Linux Toolchain is also available. You can get it from here.

Linaro Developers Wiki - an open organization focused on improving Linux on ARM, will be a good reference for your work.

翻译:使用这个工具链,你可以用C标准库来交叉编译你的C程序,而无需startup code?你的程序可以在你的x86的Linux主机上交叉编译然后直接运行在Linux(ARM)平台上。 ARM-Linux工具链的windows版本也是可用的,你可以从这里获取。 Linaro Developers Wiki - 一个致力于改进ARM平台Linux的开发组织,这对于你的工作将会是个很好的参考。

源链接:http://stackoverflow.com/questions/14564978/compiling-a-linux-program-for-arm-architecture-running-on-a-host-os

其二,来自 askUbuntu,关于在Ubuntu上如何安装ARM工具链的回答。

.....However, if you're looking for an ARM cross-compiler, there is one pre-packaged in Ubuntu, which may be easier to get running. It's in the gcc-arm-linux-gnueabi package - to install it:

翻译:但是,如果你正在寻找一个 ARM 平台的交叉编译器,在Ubuntu中倒是有一个打包好的,它或许比较容易运行。它在 gcc-arm-linux-gnueabi 包中,你可以这样安装它:
sudo apt-get install gcc-arm-linux-gnueabi

源链接:http://askubuntu.com/questions/65630/installing-gnu-arm-toolchain

其三,来自stackoverflow。关于如何使用及添加到PATH方法。

CodeSourcery convention is to use prefix arm-none-linux-gnueabi- for all executables, not gcc-arm-linux-gnueabi that you mention. So, standard name for CodeSourcery gcc would be arm-none-linux-gnueabi-gcc.

After you have installed CodeSourcery G++, you need to add CodeSourcery directory into your PATH.

Typically, I prefer to install CodeSourcery into directory like /opt/arm-2010q1 or something like that. If you don't know where you have installed it, you can find it using locate arm-none-linux-gnueabi-gcc, however you may need to force to update your locate db using sudo updatedb before locatewill work properly.

After you have identified where your CodeSourcery is installed, add it your PATH by editing ~/.bashrclike this:

PATH=/opt/arm-2010q1/bin:$PATH

Also, it is customary and very convenient to define

CROSS_COMPILE=arm-none-linux-gnueabi-

in your .bashrc, because with CROSS_COMPILE defined, most tools will automatically use proper compiler for ARM compilation without you doing anything.

源链接:http://stackoverflow.com/questions/14180185/gcc-arm-linux-gnueabi-command-not-found

————————————进展——————————————

安装交叉编译器。另注:经实测,此编译链不适合mini2440。只有官方光盘里的arm-liinux-gcc4.3编译出的程序才能在mini2440上运行。

此编译器编译后的helloworld在mini2440上总是出现unexpected } 错误。

Ubuntu安装ARM架构GCC工具链(ubuntu install ARM toolchain)最简单办法的更多相关文章

  1. 【转】Ubuntu安装ARM架构GCC工具链(ubuntu install ARM toolchain)最简单办法

    原文网址:http://www.cnblogs.com/muyun/p/3370996.html 一.安装ARM-Linux-GCC工具链 只需要一句命令: sudo apt-get install ...

  2. ubuntu 安装 Sqlite 和 可视化工具 SqliteBroswer

    ubuntu 安装 Sqlite 和 可视化工具 SqliteBroswer   下载sqlite www.sqlite.org/download.html 安装Sqlite 创建一个目录:     ...

  3. Linux下获取arm的交叉编译工具链

    转载请注明文章:Linux下获取arm的交叉编译工具链 出处:多客博图 这里介绍,Linux下获取arm的交叉编译工具链,比如arm-linux-gnueabihf-gcc.arm-linux-gne ...

  4. HC32L110(三) HC32L110的GCC工具链和VSCode开发环境

    目录 HC32L110(一) HC32L110芯片介绍和Win10下的烧录 HC32L110(二) HC32L110在Ubuntu下的烧录 HC32L110(三) HC32L110的GCC工具链和VS ...

  5. HK32F030MF4P6的Linux GCC工具链和VSCode开发环境

    HK32F030MF4P6简介 航顺的 HK32F030MF4P6, TSSOP20封装, Arm Cortex M0 内核, 内建32MHz时钟, 16K Flash, 2K RAM(实际上可用的有 ...

  6. 更换gcc工具链

    title: 更换gcc工具链 date: 2019/1/16 19:27:51 toc: true --- 更换gcc工具链 下载后解压到一个临时目录先看看文件结构 mkdir tmp tar xj ...

  7. Ubuntu安装配置串口通讯工具minicom&&cutecom

    原帖地址:https://blog.csdn.net/gatieme/article/details/45310493 2017-04-07更新 发现新的工具gtkterm全名叫serial port ...

  8. ubuntu安装redis 和可视化工具

    方式一: 下载地址:http://redis.io/download,下载最新文档版本. 本教程使用的最新文档版本为 2.8.17,下载并安装: $ wget http://download.redi ...

  9. gcc工具链简述

    工具链软件包括BINUTILS.GCC.GLIBC.GDB等. BINUTILS是二进制程序处理工具,包括链接器.汇编器等目标程序处理的工具. GCC(GNU Compiler Collection) ...

随机推荐

  1. java验证码Captcha

    import java.awt.Color; import java.io.IOException; import java.util.Random; import javax.servlet.htt ...

  2. MEF依赖注入调试小技巧!

    自从哥的项目使用MEF以来,天天那个纠结啊,甭提了.稍有错误,MEF就报错,但就不告诉你哪错了,大爷的. 后来看了MEFX的相关调试方法,感觉也不太理想,根本不够直观的看到错误原因,也许是没有深入学习 ...

  3. hadoop之wordCount程序理解

    有篇文章http://www.cnblogs.com/xia520pi/archive/2012/05/16/2504205.html中介绍的

  4. 全国OA系统下载地址(全)

    思道OAhttp://www.anyoffice.net微软.NET平台,支持64位 金和OAhttp://www.jinher.com 红帆OAhttp://www.ioffice.cn 致远OAh ...

  5. StarUML启动报RPC服务器不可用错误

    有很多人说启动 Remote Procedure Call (RPC) 服务即可,还是我试过了没有起作用,后来网友说,启动Print Spooler就可以了,暂时解决了问题.

  6. iOS菜鸟之苹果开发者账号的注册

    大家一起来讨论讨论苹果开发者账号的注册(主要是以公司的开发者账号为例),前段时间公司要求注册开发者账号,于是我就特地看了看相关的帖子.这里简单给大家总结一下具体的流程. 首先你要登陆这个网址,进去之后 ...

  7. ejs 基本语法

    1.基本语法.<% code %>    无缓冲的条件语句元素.<%= code %>    转义HTML,该code并且会打印出来.<%- code %>     ...

  8. Linux中的find指令

    find find是最常见和最强大的查找命令,在磁盘中查找文件,用它找到任何你想找的文件,就是速度有点慢. find    path    -option    [    -print ]    [ ...

  9. cocos2dx 实现华丽丽的滚动层.

    前言 好久没写博客了. 前几周策划要求实现一个比较多功能的滚动层控件. 这个艰巨的任务就这样自然而然的落在了我这小身板上. 当然了, 只要我出手, 难度再高的需求也变得不堪一击. 哈哈哈哈 示例图 该 ...

  10. 【BZOJ1036】【树链剖分】树的统计Count

    Description 一 棵树上有n个节点,编号分别为1到n,每个节点都有一个权值w.我们将以下面的形式来要求你对这棵树完成一些操作: I. CHANGE u t : 把结点u的权值改为t II. ...