I have a program that has several libraries statically linked to it. It loads dynamic libraries (modules) that use those same libraries.
Instead of statically linking the modules, would it be somehow possible to dynamically link to the functions that already exist in the main program?
The problem I'm facing here is that the said libraries contain internal state (static variables), and if both the main program and modules are statically compiled, that internal state is duplicated to both places and the library doesn't work similarly from the main program and modules.