Is there a way to dynamically link shared libraries that have dependencies?
For example, I have two libraries, libA.so and libB.so. libB.so calls functions defined in libA.so.
In my main program, I wish to load the two libraries with dlopen. However, if I try:
dlopen(libA.so);
dlopen(libB.so);
Then the second dlopen will fail as libB has unrecognized symbols.
I can think of a few workarounds such as building all the object files into a single shared library, or to have libB.so call dlopen on libA.so, but that's extra work.
I guess the way I'm imagining this to work is like in the case of kernel modules where you can use "EXPORT_SYMBOL()" to allow other modules to call functions defined in a previously loaded module.
Can something similar be done with shared libraries? Or will I have to use my workarounds?