Linux下程序hello Linux GCC编译

2014-11-24 07:23:54 · 作者: · 浏览: 2

代码


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编译