I have to dynamic load .so in Linux, but I find it is difficult to deal with the same name libraries. I have 2 libtest.so in different directories and they are depend on other different libraries. My program read config file to decide to load which libtest.so. For example:
/usr/kyle/v1/libtest.so
/usr/kyle/v2/libtest.so
They are all not registered in ldconfig. So how can I load different version of libtest.so using dlopen? I hope that they will not be conflict with each other, because they may be depend on same or different other libraries. It seems that change LD_LIBRARY_PATH using putenv/setenv in my program does not work.
Newer versions of Glibc provide dlmopen for this: