Simpler Navigation for Servers and Operating Systems
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
cancel
Showing results for 
Search instead for 
Did you mean: 

Shared Library Options

Vladstone
Occasional Visitor

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,

1 REPLY
Highlighted
Dennis Handly
Acclaimed Contributor

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.