linking : selecting Symbols from 2 or more different dynamic libraries

Dear People,


I have the following question:

in libA.so i have a symbol S or function S ,plus another functions. In libB.so I have a better implementation of S, but some basic implementation is not given by libB.so.

How can I tell the linker/compiler to use the symbol S in libB.so and the other functions from libA.so. The problem is that libA.so is given or distributed with no sources, all that i know is the interface

Thanks in advacne


C doesn't really support that kind of thing. With any luck, it'll tell you it can't choose between the two.

If libB is a superset of libA, then you'd just use libB instead of libA.

If you load the functions at runtime, then you can do what you like. You can pretty much load any function from any shared lib and use it as you're bypassing the linker's attempt to keep you sane.
Topic archived. No new replies allowed.