1、首先将linux下的编译环境搭建好
2、写好程序代码(后附)
3、将文件放在制定的目录下,本人放在了 root@ubuntu:/home/linuxsystemcode/helloworld# 目录下
4、编译程序指令:
(1)PC平台:gcc helloworld.c -o helloworld
(2)嵌入式平台: arm-none-linux-gnueabi-gcc -o helloworld helloworld.c -static
5、运行:
(1)PC平台:./helloworld
(2)嵌入式平台:将文件拷贝到A9平台下,然后挂载U盘(笨方法),然后运行
mount /dev/sda4 /mnt/disk/
附件:代码
#include <stdio.h>
main()
{
printf("Hello World!\n");
}