2

Consider a scenario where there are two shared library of different version.Consider A.1.so linked to B.so and A.2.so linked to C.so. Now both B.so and C.so are linked to d.exe . When B.so wants to invoke function in A.1.so, it ends up calling function in A.2.so .Because of this , it gives us undefined behaviour.

Now I want my B.so invoke only A.1.so.I can only modify A.1.so and B.so , nothing else. Using dlopen() is one of the option, but for using dlopen(), I have to make heavy changes in B.so. There are many solutions given earlier in Stack Overflow, but nothing seems to work. Kindly note that I can make code changes in A.1.so and B.so only.

Is there any other solution to this problem other than dlopen(). I have mentioned some of the links below.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278

1 Answers1

0

can you wrap all code in A1.cpp in namespace A1 and add a using namespace A1 to B.cpp? By A1.cpp an B.cpp I mean all the relevant translation units for A1.so and B.so.

Jonathan Leffler
  • 730,956
  • 141
  • 904
  • 1,278
nriedlin
  • 195
  • 6