I have built a static library in my home directory and there is also a copy of the same library elsewhere on the filesystem. When building and linking I am interested in knowing which library it is linking against. From what I understand once the linking is done there is no way to tell for static libraries. I tried feeding the linker –verbose which strangely caused it to give full paths for some libraries but not others.
I am looking for a “which -llibraryname” command or a flag I can give the linker that would tell me the full path to a specific library. The linker is ld invoked through gfortran.
Add
-Wl,-toption. Fromman ld