Quite often I am using third party snippets of C code that uses a Unix/Linux C library, an example
#include <net/if.h>. And they require me to know the specific library file name or pkg-config name, an example
pkg-config --libs dbus-1. Note that a lot of them differ from the header file having a '2.0', '1' so you just can't guess it.
How the heck can I find out the exact name of the library file an API/library has? Using my examples above; how do I find that
#include <glib.h>'s library file is called
-lglib-2.0? It's quite frustrating that the online references for Glib/dbus/all of them don't just say "the name of the library file is glib-2.0".
Are there any terminal commands I can use to find this out? Are there utilities I can use to find this out? Online API/Library references are really bad for finding this out.
If I want to find where
hci.h is located I can easily just go
locate hci.h and find its location. Is there anything like a terminal command for finding out the library name?