0

An application links against two different shared libraries which each locally define and reference the same symbol (same at link time; e.g. after mangling)...

At run time, the code from one of the libraries ends up using the symbol definition from the other.

The obvious solution would be to rename one of the symbols, but these are third-party libraries and this would be difficult.

Is there any way to force the linker to resolve symbols preferentially within the library that is being dynamically linked?

nzc
  • 1,576
  • 1
  • 14
  • 24
  • I never tried but maybe this might be a solution https://stackoverflow.com/questions/678254/what-should-i-do-if-two-libraries-provide-a-function-with-the-same-name-generati/678309#678309 – amlucas Jun 13 '19 at 21:18
  • Luckily (?) you are working in C++. Put the symbol in a namespace and recompile. In fact, both libraries should have the symbol in a namespace. Double fail... – jww Jun 13 '19 at 21:31

0 Answers0