command in linux to create static library
ar -rcs lib.a sum.o sub.o mul.o
Here, "lib.a" is name of the static library,
and while compiling
cc main.c lib.a
command in linux to create dynamic library
cc -sh -o lib.so sum.o sub.o mul.o
Here, "lib.so" is name of the dynamic library,
and while compiling
cc lib.so main.c