link
it?gcc -c static-linking.c -o static-linking.o
gcc -c lib.c -o lib.o
gcc static-linking.o lib.o -o linked
It Works!
./linked
2+3=5
nm linked
U _add
0000000000000000 T _main
U _printf
nm lib.o
0000000000000000 T _add
Compile, link and run static-linking2.c, what happened?
ldd $(which emacs)
linux-vdso.so.1 (0x00007fff725cf000)
libtiff.so.5 => /usr/lib/libtiff.so.5 (0x00007f46288be000)
libjpeg.so.8 => /usr/lib/libjpeg.so.8 (0x00007f4628829000)
libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007f46287f1000)
libgif.so.7 => /usr/lib/libgif.so.7 (0x00007f46287e6000)
libXpm.so.4 => /usr/lib/libXpm.so.4 (0x00007f46287d2000)
.
.
.
Take a look on ldconfig tool and common shared library
<stdio.h>
<ctype.h>
<string.h>
<math.h>
<stdlib.h>
<assert.h>
<stdarg.h>
<setjmp.h>
<signal.h>
<time.h>
<limits.h>
and <float.h>
This material is genereted thanks to some extracts from following resources:
gmail | tec | intel
.com