linux下编译运行的第一个C
linux下运行的第一个C程序
root@localhost root]# vi hello.c
进入vim的命令模式,按下键盘的i切换到插入模式,输入如下代码:
#include <stdio.h>
int main()
{
printf("Hello! This is our embeded world!\n");
return 0;
}
按下Esc进入命令模式,输入:wq,自然会保存文件会退回到终端
接下来就是预处理、链接、编译、运行拉
[root@localhost root]# gcc -E hello.c -o hello.i //预处理
[root@localhost root]# gcc -S hello.i -o hello.s //编译不汇编,生成汇编文件
[root@localhost root]# gcc -c hello.s -o hello.o //编译不链接。生成目标文件
[root@localhost root]# gcc hello.o -o hello //生成执行文件
[root@localhost root]# ./hello //运行执行文件
Hello! This is our embeded world! //这就是输出的结果
相关文档:
例一:发送Signaling Packet:
Signaling Command是2个Bluetooth实体之间的L2CAP层命令传输。所以得Signaling Command使用CID 0x0001.
多个Command可以在一个C-frame(control frame)中发送。
如果要直接发送Signaling Command.需要建立SOCK_RAW类型的L2CAP连接Socket。这样才有机会自己填充Command Code,Identi ......
作者:北南南北
来自: LinuxSir.Org
摘要:本文对新增硬盘,切割硬盘,创建硬盘分区,为硬盘分区创建文件系统,以及加载文件系统的流程做总结性论述;主要是为初学者弄清楚这一操作过程;本文
涉及fdisk、mkfs、mount ... ... 等工具;对/etc/fstab 进行了解说;还有磁盘扫描工具fsck 等介绍;
++++++++++++++++ ......
几个重要的Linux系统内核文件介绍
http://vod.sjtu.edu.cn/help/Article_Show.asp?ArticleID=2079
[ 作者:佚名 转贴自:天极网 点击数:3700 更新时间:2006-3-15 ]
mynix编译自www.linux.org之Linux HowTo之Kernel How ......
这个本来以前也写过的,今天无聊复习下 再写一遍。简单的一塌糊涂,写的不咋地大家见谅哦!有空再加强 嘿嘿!
#include <stdio.h>
#include <stdlib.h>
#include <sys/socket.h>
#include <time.h>
#include <sys/types.h>
#include <netinet/in.h>
#include <netdb.h ......