dlopen a dynamic library from a static library linux C++
I've a linux application that links against a static library (.a) and that library uses the dlopen function to load dynamic libraries (.so) If I compile the static library as dynamic and link it to the application, the dlopen it will work as expected, but if I use it as described above it won't. Can't a static library uses the dlopen function to load shared libraries? Thanks. There should be no problem with what you're trying to do: app.c: #include "staticlib.h" #include "stdio.h" int main() { printf("and the magic number is: %d\n",doSomethingDynamicish()); return 0; } staticlib.h: #ifndef _