ubuntu如何跑arm程序

时间:2014-08-12 18:15:34   收藏:0   阅读:306

1. 首先确定一间配置好arm linux 交叉编译器,可以使用arm-linux-gcc.

2. 看示例代码hello.c

#include<stdio.h>

int add(int a,int b){
	int c = a+b;
	return c;
}

int main()
{
	printf("Ubuntu, i am linux-arm-toolchain\n");
}

3. 在hello.c文件的目录下面执行:arm-linux-gcc -static hello.c -o hello

4. 把qemu-arm可执行文件放入到/usr/bin目录下面,sudo cp qemu-arm /usr/bin/

  qemu-arm 可以在我的网盘里面下载:http://pan.baidu.com/s/1mgl0EQs

5. 在hello.c文件的目录下面执行:qemu-arm hello

 输出:Ubuntu, i am linux-arm-toolchain

ubuntu如何跑arm程序,布布扣,bubuko.com

评论(0)
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!