arm汇编--ubuntu12.04 安装arm-linux交叉编译环境
1. 安装标准的C开发环境,由于Ubuntu安装默认是不安装的,所以需要先安装一下:
sudo apt-get install gcc g++ libgcc1 libg++ make gdb
2.从ftp://ftp.arm.linux.org.uk/pub/armlinux/toolchain/下载最新版本的交叉编译器,我下载的是cross-3.2.tar.bz2,解压到Downloan目录,会生成home/Downloads/usr/local/arm/,然后sudo cp -r arm /usr/local/arm/
3.把交叉编译器的路径加入到PATH
sudo vi /etc/bash.bashrc
在后面加入如下代码:
if [ -d /usr/local/arm ] ; then
PATH=/usr/local/arm/bin:"${PATH}"
fi
4.使新的环境变量生效
# source /etc/profile
5.检查是否将路径加入PATH的方法:
echo $PATH
如果显示的内容中有/usr/local/arm/bin,说明已经将交叉编译器的路径加入PATH
自此,交叉编译环境安装完成。
6. 测试示例:
代码hello.c
- #include<stdio.h>
- int main()
- {
- printf("Ubuntu, i am linux-arm-toolchain\n");
- }
终端进入到hello.c所在的目录,执行:
arm-linux-gcc hello.c -o hello
编译成功。
碰到的问题:
从网上拷贝了一份比较简单的代码,编译时遇见以下问题:
test_getopt.c:9:35: error: stray ‘\342’ in program
test_getopt.c:9:35: error: stray ‘\200’ in program
test_getopt.c:9:35: error: stray ‘\235’ in program
test_getopt.c:12:3: error: stray ‘\342’ in program
test_getopt.c:12:3: error: stray ‘\200’ in program
test_getopt.c:12:3: error: stray ‘\230’ in program
test_getopt.c:12:3: error: stray ‘\342’ in program
test_getopt.c:12:3: error: stray ‘\200’ in program
test_getopt.c:12:3: error: stray ‘\231’ in program
test_getopt.c:13:4: error: stray ‘\342’ in program
test_getopt.c:13:4: error: stray ‘\200’ in program
说一下,出现此问题的原因是,源代码中存在汉语时的字符,如“”、,等,将其改过来即可!
arm汇编--ubuntu12.04 安装arm-linux交叉编译环境的更多相关文章
- Ubuntu 16.04 安装 arm-linux-gcc 嵌入式交叉编译环境 问题汇总
闲扯: 实习了将近半年一直在做硬件以及底层的驱动,最近要找工作了发现了对linux普遍要求很高,而且工作岗位也非常多,所以最近一些时间在时不时地接触linux. 正文:(我一时兴起开始写博客,准备不充 ...
- Ubuntu12.04 安装Samba
Ubuntu12.04 安装Samba Ubuntu12.04 安装Samba 本教程介绍了在Ubuntu12.04安装Samba文件服务器,以及如何配置它通过SMB协议共享文件,以及如何将用户添加. ...
- [分享]Ubuntu12.04安装基础教程(图文)
[分享]Ubuntu12.04安装基础教程(图文) 原文地址: http://teliute.org/linux/Ubsetup/lesson21/lesson21.html 1.进入 live cd ...
- Ubuntu12.04安装64位系统出现编译错误error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or dir
问题: Ubuntu12.04安装64位系统出现编译错误error while loading shared libraries: libz.so.1: cannot open shared obje ...
- ubuntu12.04安装svn 1.7(转载)
ubuntu12.04安装svn 1.7 分类: ubuntu2013-10-22 16:03 239人阅读 评论(0) 收藏 举报 svnubuntu 目录(?)[+] 1.问题 在 ...
- ubuntu12.04 安装 php5.4/php5.5
1:修改源(我使用163的源)直接修改/etc/apt/sources.list deb http://mirrors.163.com/ubuntu/ precise main universe re ...
- Ubuntu12.04安装java6
按照android官方文档 http://source.android.com 下载编译android源代码,jdk安装失败,尝试一下方法成功(2013-11-20) 下面我就把在Ubuntu12.0 ...
- ubuntu12.04 安装nginx+php+mysql (lnmp)的web服务器环境
1.Ubuntu12.04 安装nginx+php+mysql (lnmp)的web服务器环境 http://blog.db89.org/ubuntu12-04-install-nginx-php-m ...
- ubuntu 14.04 安装torch及编译环境zbstudio
ubuntu 14.04 安装torch及编译环境zbstudio torch zbstudio 本来是安装官网给的步骤安装torch的,可是碰到一系列的问题,后来参考网上的安装方法安装成功了 官网安 ...
随机推荐
- 九度OJ 1371 最小的K个数 -- 堆排序
题目地址:http://ac.jobdu.com/problem.php?pid=1371 题目描述: 输入n个整数,找出其中最小的K个数.例如输入4,5,1,6,2,7,3,8这8个数字,则最小的4 ...
- OpenJudge/Poj 1631 Bridging signals
1.链接地址: http://poj.org/problem?id=1631 http://bailian.openjudge.cn/practice/1631 2.题目: Bridging sign ...
- 使用VirtualBox搭建Pentesterlab环境
1 简介 VirtualBox 是一款开源虚拟机软件,我们使用它来装载Pentesterlab的镜像文件. 2 VirtualBox安装及配置 VirtualBox的安装项主要是网卡的配置比较麻烦,不 ...
- jQuery iframe 自适应高宽度
Html <iframe id="你的id" src="你要嵌入的页面" scrolling="no" frameborder=&qu ...
- grunt-npm编译bootstrap源码
因为gmu需要用编译的方式下载,于是联想到bootstrap什么less sass编译 less先学,据说基于js编译和less编译器,安装起来详细, sass据网上介绍基于ruby, 以下为在mac ...
- form表单提交的方法
最近研究了下html中,form保单提交的几种方法,现与大家分享一下(注:网上可能已经有好多版本了,这里自己写下来做个总结了,哈!): 方法一:利用form的onsubmit()函数(经常使用) &l ...
- Uva 10288 Coupons
Description Coupons in cereal boxes are numbered \(1\) to \(n\), and a set of one of each is require ...
- [原博客] POI系列(5)
正规.严谨.精妙. -POI BZOJ 2213 : [Poi2011]Difference 如果我们每次枚举两个字母最大最小情况时,很容易想到写出代码里注释的样子.这样是26*26*n的,我们发现枚 ...
- Stanford CoreNLP--Part of Speech
Stanford CoreNLP Part Of Speech简称POS,主要是对待分析的句子中的单词进行标记的功能,如标记名词.动词等,该组件是CoreNLP工程的一部分,详细内容可参考:CoreN ...
- nginx日志配置
nginx日志配置 http://www.ttlsa.com/linux/the-nginx-log-configuration/ 日志对于统计排错来说非常有利的.本文总结了nginx日志相关的配置如 ...