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的,可是碰到一系列的问题,后来参考网上的安装方法安装成功了 官网安 ...
随机推荐
- 获取本机IP、mac地址、计算机名
python获取本机IP.mac地址.计算机名 在python中获取ip地址和在php中有很大不同,我们先来看一下python 获得本机MAC地址: >>> import uuid ...
- 禁止选择文本和禁用右键 v1.0
var zhonghao={ //绑定事件 myAddEvent: function(obj, sEvent, fn){if(obj.attachEvent){obj.attachEvent('on' ...
- gentoo下的wpa_supplicant无线网配置
在linux使用wpa_supplicant获得无线网的最痛苦的是莫过于去配置wpa_supplicant.conf文件了(当然对于linux老手这不算什么), 但是可以用一种简便的方法直接输入命令行 ...
- linux 配置apache+subversion
http://apr.apache.org/download.cgi http://subversion.tigris.org/servlets/ProjectDocumentList?folderI ...
- 【python】for循环一列
a="哈哈哈哈,笑死我了"for i in a: print (i, end=' ') 结果 哈 哈 哈 哈 , 笑 死 我 了
- 2016030207 - sql50题练习(脚本)
我的mysql版本是5.下面是要进行sql练习题使用的脚本.脚本是我整理出来的,在我本地直接复制执行就可以使用! 参考网址是:http://blog.csdn.net/zhangyulin54321/ ...
- UITextView -- 基础备忘
UITextView 这篇文章只涉及到基本的使用,日后会写一些关于结合TextKit的备忘 基本属性 let screenSize = UIScreen.mainScreen().bounds.siz ...
- xcode 升级插件失效问题
摘要 Xcode 升级到7之后VVDocumenter-Xcode,OMColorSense,KSImageNamed等一系列的插件失效的解决办法,以及不小心误点了 Skipbundle 的解决办法 ...
- 解决在HTTPS页面里嵌套HTTP页面浏览器block的问题
问题描述: 浏览器默认是不允许在HTTPS里面引用HTTP页面的,ie下面会弹出提示框提示是否显示不安全的内容,一般都会弹出提示框,用户确认后才会继续加载,但是chrome下面直接被block掉,只在 ...
- c++ 标准委员会网址
c++ 标准委员会网址: http://www.open-std.org/ C++11 文档网址: http://www.open-std.org/jtc1/sc22/wg21/docs/papers ...