[LC++]Path of a shared library
Adriano dos Santos Fernandes
adrianosf at uol.com.br
Sun Oct 24 12:11:01 UTC 2004
I'll try to use dladdr.
Jack Lloyd wrote:
> Actually, if your application is built with a hard-coded library path, it's
> possible you won't find a library you're linked against in LD_LIBRARY_PATH or
> You can try using dladdr(), but it's somewhat tricky to use. It works,
> sometimes, but often the path you get back is relative instead of absolute,
> lots of stupid little problems like that.
> On Thu, Oct 21, 2004 at 08:08:10PM -0300, Adriano dos Santos Fernandes wrote:
>>In Windows is possible to discover the path of a DLL in the entry-point,
>>using GetModuleFileName with the HINSTANCE of the DLL.
>>I knew one way to do this in Linux. Using the LD_LIBRARY_PATH
>>environment variable and looking for the filename.
>>Is there a better way to do this?
>>If not, the correct way to do is only look for files in LD_LIBRARY_PATH
>>environment variable or have other directories to find too?
More information about the tuxCPProgramming