Yes
-l is required with all the shared libraries (only) and that the
gcc never looks into any *.so by default. We also do provide
-L flag in the makefiles for
gcc to look for but it's the directory path, wherein there could be many library archieves (i.e. *.a).
Wherein we also provide a path for
nm to look into, isn't it?
There were times when I've used altogather a new APIs by just looking at header files declerations and searched the relevant *.a file path to be included into the makefile.
gcc was extremely quick to locate the relevant libxxx.a file (out of a number of such archieves) to add the correct library without significantly impairing the overall build time.
I was suspecting to have some kind of global symbol maintainance job by
gcc (
global -for given a system) with an on the fly addition (or may be deletion when the
Symbol-Path combination produces error) as and when a new symbol is encountered to be linked into with the build. Which won't be dependable all the time, as otherwise that would hamper the portability of the source , but wanted to confirm that
.