Shared Library Options (208 Views)
Reply
Occasional Visitor
Vladstone
Posts: 1
Registered: ‎08-16-2011
Message 1 of 2 (208 Views)

Shared Library Options

Is there anyway to set up a c++ application that searches for a function in shared libraries as follows:

 

1) Look in the shared library in the current directory

2) If not found in the current directory's shared library look for a shared library of the same name on the search path and try to find the function there.

 

Thanks,

Please use plain text.
Acclaimed Contributor
Dennis Handly
Posts: 24,962
Registered: ‎03-06-2006
Message 2 of 2 (204 Views)

Re: Shared Library Options

Are you talking about searching at link time, load time or at runtime?

The first can be done with -L path options.

The second with LD_LIBRARY_PATH and -Wl,+b paths

The third with dlopen and dlsym.

Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation