Static and dynamic libraries

gcc -c lib_mylib.c -o lib_mylib.o
ar rcs lib_mylib.a lib_mylib.o
gcc -c driver.c -o driver.o
gcc -o driver driver.o -L. -l_mylib
./driver 
fun() called from a static library

--

--

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