Static vs Dynamic Libraries

What is a library and how do we use them?

#include <stdlib.h>

What is the difference between static and dynamic?

How do I make a library?

gcc gcc -options_here -c *.c
ar -rc libname.a *.o
ranlib libname.a
gcc -options -L/path randcfile.c libname.a
gcc -optionshere -fPIC -c *.c
gcc -shared -Wl,-soname,libname.so -o liball.so *.o
ln -sf /opt/lib/libname.so
gcc -otheroptions -L/opt/lib prog.c -lname
ldconfig -options dir1 dir2 diretc
nm -D libname

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store