You can't even tell whether a given symbol looked up with dlsym is a function or data!
Re:> In some situations, in order to build against a DLL you need need an accompanying "lib" file. If you do not have one
.lib files are not required to use a DLL. A DLL is opened with LoadLibrary and symbols can be resolved with GetProcAddress. Those import .lib files are just some quirk of Microsoft Visual C.
> You can't even tell whether a given symbol looked up with dlsym is a function or data!
On many modern unixes you can! Functions will usually be in a "text" section (marked execute or read+execute) and data will usually be in a "data" or "bss" section (marked read-only, or read-write).
The dl* family of functions don't expose this information, but after getting a symbol you can check the protection bits on the page the pointer is on (using a system-defined mechanism).
Re:> In some situations, in order to build against a DLL you need need an accompanying "lib" file. If you do not have one
.lib files are not required to use a DLL. A DLL is opened with LoadLibrary and symbols can be resolved with GetProcAddress. Those import .lib files are just some quirk of Microsoft Visual C.