Linking two shared object libs with same symbols, Solaris 2.6

cesars_at_nortelnetworks.com
Date: 06/07/04


Date: 7 Jun 2004 07:32:14 -0700

I have an application running on Solaris 2.6 that is linking with two
shared object libs ( libv2.so and libv4.so ). These two libs are
basically two wrapper classes that make API calls to two other .so
libs ( libver2.so and libver4.so ), the API functions are the
same on both libver2.so and libver4.so, that's the reason I created
the wrapper classes. The libv2.so links with libver2.so and libv4.so
links with libver4.so without any problems.

My app compiles and links without any problems either, but when I run it,
only one set of the API calls work, either the one on libver2.so or
libver4.so, but not both at the same time.

I have narrowed the problem to the order of the libraries at linking
time. If I do "..... -lv2 -lv4 ......" only the API calls to liver2.so work
but not the ones to libver4.so. If I reverse the order of the libraries
"..... -lv4 -lv2 ....." the opposite happens and only API calls in the
libver4.so work.

How do I make the executable to actually have both of them at the same
time?

Cesar