[dywang@dyw219 zzz]$ vi hello.c #include <stdio.h> main() { printf("Hello!\n"); }
[dywang@dyw219 zzz]$ gcc -c hello.c
[dywang@dyw219 zzz]$ ll hello.* -rw-rw-r--. 1 dywang dywang 58 Apr 26 15:20 hello.c -rw-rw-r--. 1 dywang dywang 1488 Apr 26 15:20 hello.o
[dywang@dyw219 zzz]$ gcc -O hello.c -c
[dywang@dyw219 zzz]$ gcc -o hello hello.c [dywang@dyw219 zzz]$ ll hello* -rwxrwxr-x. 1 dywang dywang 6663 Apr 26 15:22 hello -rw-rw-r--. 1 dywang dywang 58 Apr 26 15:20 hello.c -rw-rw-r--. 1 dywang dywang 1488 Apr 26 15:20 hello.o
[dywang@dyw219 zzz]$ gcc -o hello hello.c -Wall hello.c:2:1: warning: return type defaults to ‘int’ [-Wreturn-type] main() ^ hello.c: In function ‘main’: hello.c:5:1: warning: control reaches end of non-void function [-Wreturn-type] } ^
[dywang@dyw219 zzz]$ gcc -o hello1 hello.c -lm -L/usr/lib -I/usr/include
[dywang@dyw219 zzz]$ ldd hello linux-vdso.so.1 => (0x00007fff308dd000) libc.so.6 => /lib64/libc.so.6 (0x000000394aa00000) /lib64/ld-linux-x86-64.so.2 (0x0000560fe1b54000) [dywang@dyw219 zzz]$ ldd hello1 linux-vdso.so.1 => (0x00007ffce89bb000) libm.so.6 => /lib64/libm.so.6 (0x000000394ae00000) libc.so.6 => /lib64/libc.so.6 (0x000000394aa00000) /lib64/ld-linux-x86-64.so.2 (0x000055a2b0e7f000)