I am linking to two different shared libraries. Both libraries define some characters that have a name but have different implementations. I can not get each library to use its own implementation compared to the other.
For example, both libraries define the global function bar() , which each calls internally. The library calls it from foo1() , and the library two calls it from foo2() .
Lib1.so:
T bar T foo1()
Lib2.so:
T bar T foo2()
If I attach my application to Lib1.so, and then Lib2.so, then the line call from Lib1.so is called even when foo2() called. If, on the other hand, I associate my application with Lib2.so and then Lib1.so, then bar is always called from Lib2.so.
Is there a way for a library to always prefer its own implementation over any other library?
c gcc unix dynamic-linking shared-libraries
drewag Jun 30 '11 at 17:11 2011-06-30 17:11
source share