It looks in the default directories /lib then /usr/lib (disabled with the -z nodeflib linker option).
Read moreDoes gcc automatically link?
When the -fsanitize=address option is used to link a program, the GCC driver automatically links against libasan . If libasan is available as a shared library, and the -static option is not used, then this links against the shared version of libasan .
Read moreWhich gcc option is used to link the library?
gcc -l links with a library file. gcc -L looks in directory for library files.
Read moreHow do I open a shared library in Linux?
A shared library can be accessed through different names :
Read moreWhat is shared library linking?
A shared library is a file containing object code that several a. out files may use simultaneously while executing. When a program is link edited with a shared library, the library code that defines the program’s external references is not copied into the program’s object file . Instead, a special section called .
Read moreCan I statically link a shared library?
You can’t statically link a shared library (or dynamically link a static one). The flag -static will force the linker to use static libraries (. a) instead of shared (. so) ones.
Read more