Linux学习之路3-HelloWorld

1、window系统上创建helloworld.c文件,并编写程序

#include <stdio.h>

main(){
	printf("Hello World!");
}

2、程序文件导入Ubuntu系统的某一文件夹下,从超级终端进入该文件夹,运行命令:  

  arm-none-linux-gnueabi-gcc -o helloworld helloworld.c -static

  编译后生成helloworld文件

3、将编译文件拷贝到U盘。

4、开发平台开机,进入终端控制台,插入U盘,可看到多出的盘符,如:sda1

5、挂载U盘,输入命令:mount /dev/sda1 /mnt/udisk/(udisk文件夹若没有,就提前创建)

6、执行helloworld程序,./mnt/udisk/helloworld

 

posted @ 2019-03-23 11:10  在路上2019  阅读(316)  评论(0编辑  收藏  举报