Generating a VST plugin which depends upon a prebuilt dynamic library

Hello to all,

I am generating a plugin which depends upon a prebuilt dynamic library on windows.

Whats happening?

  • I am able to do that by giving relevant paths to the library and library headers
  • But I am not able to integrate it in REAPER DAW on windows (I have tried copying the external DLL in the same VST plugin folder which REAPER is using)

However I was able to integrate it in REAPER when I was not using the external library.

Do the VST Plugins should necessarily be a single file plugin?

When you use a dll from a plugin linked so that the plugin depends on it at load time, the dll won’t be searched from the location where the plugin dll itself is. You could put the dll into the folder where the host’s .exe is, or into Windows’s system folder. Both options are bad and should be avoided.

There is the option of using the external dll so that you load the dll and resolve the functions from the dll manually in your code. Then you can have the external dll in whatever place you like, including the same folder where the plugin’s dll is. This may get tiresome and error prone to do if you need to do use many functions from the external dll, as each used function needs to have its own function pointer and each function pointer needs to be loaded from the dll.

There is no chance for you to build the external library yourself, the library developer only provides prebuilt dll files? If there is a way to build it yourself or at least statically link the library, that would be the best way to do it for plugins.

+1 for static linking.

I wonder though: Since VST3 offers now to be a bundle on Windows too, is there a way to tell windows to load a 3rd party dll from the Resources folder or from the folder next to the plugin binary (under MyPlugin.vst3/Contents/x86_64-win/)?

The Steinberg VST3 bundle is just their suggested convention, Microsoft and Windows do not have any explicit support for it.

Yes, Windows won’t by default, but the host could allow that, since it is loading the VST itself from a bespoke location too (which is technically just a dll too).

Well, I am speculating, somebody would need to test it (and then test several/all hosts)…

I forgot to clarify, that no, Windows does not have a way change/set the automatic dll search paths. (At least as far as I recall.)