arm汇编--ubuntu12.04 安装arm-linux交叉编译环境
2014-08-11 15:50
423 查看
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
终端进入到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
说一下,出现此问题的原因是,源代码中存在汉语时的字符,如“”、,等,将其改过来即可!
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
说一下,出现此问题的原因是,源代码中存在汉语时的字符,如“”、,等,将其改过来即可!
相关文章推荐
- ubuntu12.04 64建立交叉编译环境,bin/.arm-none-linux-gnueabi-gcc: not found(安装 ia32-libs)
- Ubuntu12.04安装交叉编译工具链arm-linux-gcc
- 嵌入式 交叉编译环境安装arm-linux-gcc
- linux下安装两个不同版本的交叉编译环境arm-linux-gcc4.4.3、arm-linux-gcc3.4.1,切换调用的解决
- 安装arm-linux-gcc交叉编译环境
- linux安装arm-linux-gcc-4.3.2(交叉编译环境搭建)
- ubuntu12.04 (32/64 bits) 安装配置 arm-linux-gcc-4.5.1 交叉编译工具链
- ubuntu12.04 (32/64 bits) 安装配置 arm-linux-gcc-4.5.1 交叉编译工具链
- ubuntu14.0安装arm-linux-gcc交叉编译环境
- VMware虚拟机中的Ubuntu安装arm-linux-gcc交叉编译环境
- VMware虚拟机中的Ubuntu安装arm-linux-gcc交叉编译环境
- vmware虚拟机上ubuntu操作系统安装arm-linux-gcc交叉编译环境
- arm-linux-gcc交叉编译环境安装(已验证可行)
- vmware虚拟机上ubuntu操作系统安装arm-linux-gcc交叉编译环境
- arm-linux-gcc交叉编译环境安装
- vmware虚拟机上Redhat操作系统安装arm-linux-gcc交叉编译环境
- 安装交叉编译环境arm-linux-gcc
- ubuntu12.04建立交叉编译环境,bin/.arm-none-linux-gnueabi-gcc: not found
- vmware虚拟机上ubuntu操作系统安装arm-linux-gcc交叉编译环境
- LTP在arm-linux-交叉编译环境上的安装