DynamicObject question

I’m wondering what the best way to load a dynamic library from a dynamic library (like a plugin) is?

I am vaguely aware that you can use code like this to load a DLL at runtime:

//for DLL runtime loading .... needed for plugins to load DLLs
#include <dlfcn.h>

 void* library = dlopen("/Users/aaronleese/Desktop/Livetronica Studio/libs/libDSPFiltersiOS.a", 0);
       
 dlsym(library, ...);    // use the result in a call to dlsym 
      

But I thought there might be a better Juce way to do it?

The purpose here, of course, is to load a DLL into a plugin (which is itself a DLL, so cannot have these sort of linkages … hence the need for runtime loading).

There’s a DynamicLibrary class that wraps that stuff up in a RAII style - is that any help?