a) VTK uses static variables internally. Even if you don’t use them in your own code, they will still exist and they can cause problems.
b) The reason I mentioned templates is because https://gcc.gnu.org/faq.html#dso explicitly states that templates can cause problems for dlopen()
c) You can read more about static initialization here: https://en.cppreference.com/w/cpp/language/siof.html. It’s a tricky subject, and it’s probably not the problem…
In any case, it has been a long time since I’ve built any apps that use dlopen. I’ve already given you all the information that I have.