vst plugins with additional dlls

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

In my vst plugin I have dependencies on some external dll libs, and when Cubase does the initialization, it reports that it cannot locate components (i.e. mentioned dlls). Is there a way to pass the path of those libs to Cubase, or some specific folder where we can put necessary additional components?

Post

-misread before first coffee error-
Last edited by pljones on Sun Nov 09, 2014 5:48 pm, edited 1 time in total.

Post

Do you absolutely need the dependencies ? You should link statically if possible.
Putting the dll in the same directory as the VST will create a giant mess in the user's VST folder. These dll's will be seen as potential plugins by hosts, which will try to scan them, ...

If you can't link statically, you should put the dll in the plugin's documents folder (usually somewhere under C:/Program Data) and load it dynamically using LoadLibrary.

Post

I tried with static libraries before, but as I remember, it all ended up the same way; host was reporting that it was unable to locate dlls. I can retry it once more .

Post

summary:
-When I link static libraries, it is all the same as with dynamic linking. The host asks for dlls.
-When I add LoadLibrary to plugin constructor, the same again.
-When trying to load dlls with LoadLibrary, without linking, MinGW doesn't build the project; it gives me 'undefined reference' errors.

Post

user125 wrote:summary:
-When I link static libraries, it is all the same as with dynamic linking. The host asks for dlls.
-When I add LoadLibrary to plugin constructor, the same again.
-When trying to load dlls with LoadLibrary, without linking, MinGW doesn't build the project; it gives me 'undefined reference' errors.
If you do 'dynamic linking' using LoadLibrary, you cannot reference the functions in the header. You need to do something like this:

Code: Select all

	// dll:
	int func(double a);
	
	// your program - for each function, do this:
	typedef int (*pFunc)(double);
	pFunc func = NULL;
	
	// dynamic binding
	void bind()
	{
		HMODULE hMod = LoadLibrary(...);
		func = (pFunc)GetProcAddress(hMod, "func");
		assert(func);
		// should be all good.
		int ret = func(3.14);
		
	}

Post

If the host is asking for a DLL then you are not really linking statically. Note that you need to use a static version of the same library (you can't use static linking with just a DLL version). Most libraries have static versions available though (or you can compile one) unless you're stuck with some LGPL licensing non-sense.

With LoadLibrary() you don't link the DLL, instead you load the DLL then explicitly ask for pointers to each function (or other symbol) that you want to use. I wouldn't really recommend this though, unless you are comfortable with function pointers and other "low-level" stuff.

Post

Ok, I solved this by linking statically, but now the host won't load my plugin.

Post

user125 wrote:Ok, I solved this by linking statically, but now the host won't load my plugin.
Well.. What is the error? Did you try to debug it?

Post

Nothing, no error message; but I found some access violation reports in log , from past few days. Access violation on winapi libs, e.g. ole32.dll, which is also linked in my project; although I doubt that this is relevant, but it's the only thing I found.

Post Reply

Return to “DSP and Plugin Development”