开发环境:ubuntu10.04
硬件资源:fl2440
首先在PC(linux)下/root目录下新建一个目录mytest,然后vi hello.c编辑应用程序
#include <stdio.h>
int main()
{
printf("Hello World!\n");
return 0;
}
编辑完成后,:wq保存退出。然后编写一个Makefile:
KERNEL = /root/linux-2.6.12
CC = /usr/local/arm/3.4.1/bin/arm-linux-
hello:hello.c
$(CC)gcc -I$(KERNEL) -o hello hello.c
clean:
rm -f *.o
:wq保存退出。
执行make命令。最后生成hello 文件。然后通过NFS挂载,在开发板上执行./hello会显示Hello World!
实验成功。