You usually don't pass the whole name of the library (that is complete with its extension), for instance when you link with
librt you don't pass directly
librt.so or
librt.a, but use instead the
-lrt switch on command line (please note you do the same thing on Windows, for both dynamic or static libraries the input file to the linker is a
.lib one).
man[
^] provides a good explanation of both
-BStatic and
-Bdynamic.