Using Juce dynamic library with run-time loading


#1

Hello, I’m pretty new to linking-kind of things and would like to ask community for help on how can I use Juce dynamic library by linking it at run-time.

Tool I use has it’s own build tool and has absolutely no documentation on load-time linkage so loading classes and functions at run-time is the only way to go for me.
I’m kinda ok with classic C-type functions where basic algorithm is

  • getting dll handle ( LoadLibrary() )
  • declaring function pointer
  • Binding actual function to dll one ( GetProcAddress() )

But I just have no idea what am I supposed to do to import classes.
Looks like a general way of importing class at runtime is making an abstract class and inheriting it with required Juce class to return a pointer to it with a factory function but that would mean I should make changes to every Juce class I would want to use.
Is that the only way? Is there any method of obtaining class without modifying dll?


#2

That doesn’t make a whole lot of sense… What is this tool you’re talking about?


#3

I’m using UE4’s Unreal Build System with it’s UnrealBuildTool.
Mostly all linkage is done at Build.cs file.
Static libraries are linked just fine there, but looks like the only known way of linking dlls is at the run-time.


#4

Why not just add the juce code directly, and avoid messing about with any kind of libs? The whole juce module system is designed to make it as easy as possible to do that.


#5

The only real benefit using dll for me at the moment is a super-easy way of updating.
That’s no critical at all, I still can use a direct code adding / static linking, just did want understand if it’s possible to load classes from juce at run-time without touching it’s code.