Rumah > Soal Jawab > teks badan
#include<stdio.h>
int main()
{
printf("hello world!\n");
return 0;
}
a.out main.c
$ gcc -static main.c
[localhost test]$ gcc -static main.c
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status
$ gcc main.c
$ ls
test]$ ldd a.out
linux-vdso.so.1 => (0x00007fff0c3fe000)
libc.so.6 => /lib64/libc.so.6 (0x00007f5cbb43a000)
/lib64/ld-linux-x86-64.so.2 (0x00007f5cbb802000)
[root@ctos helloworld]# gcc -static hello.c
[root@ctos helloworld]# ls
a.out hello hello.c hello.go mv
[root@ctos helloworld]# ldd a.out
not a dynamic executable
[localhost test]$ gcc -static main.c
/usr/bin/ld: cannot find -lc
collect2: error: ld returned 1 exit status