I have two versions (with almost identical API) of same shared library. I must use them in same application. I know how to resolve name clashes in the headers -- I will just import them like this
namespace version1 {
#include "version1/library.h"
}
namespace version2 {
#include "version2/library.h"
}
I do not know though how I resolve linking clashes -- library is dynamically linked. First version creates following structure in custom lib folder:
libsomething.so -> libsomething.so.2
libsomething.so.2 -> libsomething.so.0.8.31.1
libsomething.so.0.8.31.1
second one:
libsomething.so -> libsomething.so.2
libsomething.so.2 -> libsomething.so.0.8.32
libsomething.so.0.8.32
My target environment is Linux machine.
Context:
I have source of libraries but they are downloaded and compiled automatically so I would like to avoid changing anything in CMakeProject of those libs but I can do it if other options are to complicated. I would prefer solution that does changes to those libs after compilation e.g. change soname. But again if I have to do some complicated stuff in app code to use those libs I prefer doing changes to these libs project and maintaining them (because version can change but there will always be two of them -- one version will probably be set forever and never updated so I would prefer to change this non changing version).