In linux
using GNU Make
environment, the process of linking with static library is
gcc obj1.o obj2.o staticlib.a -o outfile
//not considering include path for static library
and, linking with a dynamic library is
gcc obj1.c obj2.c -o outfile -labc
//dynamic library is libabc.so, not considering the path
From the man
page of gcc
we can see that,
- -l Search the library named library when linking. The directories searched include several standard system directories plus any that you specify with -L
- -L Add directory to the list of directories to be searched for -l.
Please update your makefile accordingly.
Cheers!!