0

I'm trying to use the Leap motion sdk with a JUCE vst plugin under Windows 10 x64.

I have setup my project exactly like this, and made sure that Leap.dll was in my output, VstPlugins directory. However my DAW (Reaper) cannot detect/open my plugin's dll. I have also tried to put my x86 Leap.dll in C:\Windows\System32 (and my x64 version in C:\Windows\SysWOW64), and tried to regsvr32 them, only to be told the DLLRegistryServer entry point cannot be found.

When I comment everything related to the Leap sdk, my plugin is detected in Reaper and everything else works, and on Mac OSX I am able to use the Leap as well, so it seems my problem is really that my Windows system does not know it has to use Leap.dll with my plugin's dll. How does one go about doing this?

6
  • and tried to regsvr32 them Why did you do that? I do not see regsvr32 at all in the instructions. Did you copy the dlls to the same location as your applications executable like the xcopy part from the example?
    – drescherjm
    Jan 13, 2016 at 18:15
  • yes I did copy the Leap dll in the same folder as my plugin dll--my output is a dll, not a .exe. And I tried the regsvr32 technique (with dlls in the system folders) because this has worked in the past for me to use other dlls. And because I didn't know what else to do! Jan 13, 2016 at 18:25
  • Did you build dlls for the SDK (I could not download to see without registration)? I ask because if you downloaded a binary release and you do not have the correct ependencies of the dll (installed on your system) the dll will not load even though you have it in the correct folder.
    – drescherjm
    Jan 13, 2016 at 18:35
  • Your conclusion is quite backwards, it stops working when it does have a dependency on Leap. Probably a missing DLL, use SysInternals' Process Monitor to see your DAW looking for it and not finding it. Jan 13, 2016 at 18:38
  • @drescherjm, I figure you're referring to the Leap SDK? They don't give the source code, only the dlls. And no static lib. And their instructions clearly say that we only need the Leap.dll. And using Leap.dylib works on mac. Jan 13, 2016 at 18:48

1 Answer 1

1

If it is a dynamic library you do not need to include it in your project. All you need is to copy the file onto user's machine in a specific folder and then in your plugin code add something like this:

DynamicLibrary dynLib;
bool loaded = dynLib.open("DYNAMIC_LIBRARY_FULL_PATH");
if(loaded)
{
    FUNCTIONTEMPLATE functiontemplate = (FUNCTIONTEMPLATE) dynLib.getFunction("functionName");
    char *input;
    int output = functiontemplate (input);
}

Of course if you did not write the dynamic library yourself, then you need something like dependency walker to check inside the dll and find the function declaration or read the documentation from whoever wrote the dll. Anyway, you need to know the exact function declaration format and create a pointer to that. Imagine it is function that accepts char* as input and returns int as output, then you need to have a line like this on top of your .cpp or .c code:

typedef int (*FUNCTIONTEMPLATE) (char *);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.