gcc option -l
-llibrary
- Search the library named library
when linking.
The linker searches a standard list of
directories for the library. The directories
searched include several standard system
directories plus any that you specify with -L.
It makes a difference where in the command you
write this option; the linker searches and
processes libraries and object files in the order
they are specified. Thus, foo.o -lz bar.o
searches library z after file foo.o but before
bar.o. If bar.o refers to functions in z, those
functions may not be loaded.