设为首页 加入收藏

TOP

Linux下程序hello Linux GCC编译
2014-11-24 07:23:54 来源: 作者: 【 】 浏览:0
Tags:Linux 程序 hello GCC 编译

代码


int main(int argc,char **argv)
{
printf("Hello Linux\n");
}


奇怪Linux居然不定义头文件 还是编译器自动包含默认的了



SHELL


hopebao@hopebao-virtual-machine:~$ cd /home/hopebao/桌面/1 //进入目录
hopebao@hopebao-virtual-machine:~/桌面/1$ gcc -o hello hello.c //编译文件
hello.c: In function ‘main’: //不知道这个错误什么意思
hello.c:3: warning: incompatible implicit declaration of built-in function ‘printf’
hopebao@hopebao-virtual-machine:~/桌面/1$ ./hello //不能直接双击运行 而要 ./hello
Hello Linux //现实内容
hopebao@hopebao-virtual-machine:~/桌面/1$


Linux下程序hello Linux GCC编译


】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇Shell Perl 脚本查询 MySQL DB 下一篇简单的Linux字符设备驱动

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·数据库:推荐几款 Re (2025-12-25 12:17:11)
·如何最简单、通俗地 (2025-12-25 12:17:09)
·什么是Redis?为什么 (2025-12-25 12:17:06)
·对于一个想入坑Linux (2025-12-25 11:49:07)
·Linux 怎么读? (2025-12-25 11:49:04)