Yes. Note that loading libraries is platform-dependant (Windows uses the LoadLibrary()
, dlopen
call for example). On windows they are DLLs
, and on *NIX, .SO
s. It's not too difficult though, you can abstract away the actual implementation details to platform-specific classes which is just what many C++ plugin architectures do to allow the program to dynamically load a module at runtime.
As for the second part of your question, whilst I am not sure about the memory part, surely the .zip
file part is simply a case of using an Api to extract said library from the zip file in to a temporary location and then dynamically loading the library from there? The same would be said for a custom-pack file, you just have a separation of concerns, namely:
- Extracting the library from the custom-pack file, zip file, whatever to a temporary location (where the user has write permissions)
- Loading the library as you normally would (e.g.
LoadLibrary()
) - Clean up after yourself.
There is no (AFAIK) platform-agnostic, or even platform-dependent way of loading directly from a zip file, and nor should there be as it is somewhat niche. Extract elsewhere, load as business-as-usual.