#apt-get install gcc (编译器)
#apt-get install gdb (调试)
#apt-get install libc6-dev (开发库)
如果没有开发库,gcc的时候就会错误
gcc h.c
h.c: In function ‘main’:
h.c:1: warning: incompatible implicit declaration of built-in function ‘printf ’
/usr/bin/ld: crt1.o: No such file: No such file or directory
collect2: ld returned 1 exit status
安装后就没有问题了:
gcc h.c
h.c: In function ‘main’:
h.c:1: warning: incompatible implicit declaration of built-in function ‘printf
gcc -o hello hello.c
hello.c: In function ‘main’:
hello.c:2: warning: incompatible implicit declaration of built-in function ‘printf’
james@debian:~$ ls
a.out h.c hello hello.c
james@debian:~$ ./hello
Hello Linux
james@debian:~$