PDA

View Full Version : LoadPlugin: unable to load


xlat808
18th April 2011, 20:20
I am getting this error message when trying to open my plugin DLL:

---------------------------
VirtualDub Error
---------------------------
Avisynth open failure:
LoadPlugin: unable to load "C:\Program Files (x86)\AviSynth 2.5\plugins\PerfPlugins.dll"
(C:\Users\madeeds\Documents\Video Performance\AviSynth\Convolution.avs, line 14)
---------------------------
OK
---------------------------

It was working fine until I tried to link in the 32-bit FFTW library (libfftw3-3.lib). I am using Visual Studio 2010 and have the target set to Win32 Debug. As you can see from the path above, AviSynth is also 32 bit.

Any tips on what's going wrong or how to debug it? I tried to debug, with VS, but as you might expect, the failure is happening before the DLL is loaded.

IanB
19th April 2011, 00:15
You probably have a library dependency issue. Run dumpbin /imports to see what runtime .dll's are needed. Then install the required runtime libraries.

Hint: you probably don't have the runtimes that libfftw3-3.lib was compiled against.

xlat808
19th April 2011, 16:32
Thanks, Ian.

I've put the version of the DLL that I generated the .lib file from into the same directory as my DLL. Do I need to load that DLL from my DLL, or does the runtime take care of that for me?

dumpbin /import lists "libfftw3-3.dll" and the functions that I use in that library. I tried calling LoadLibrary from DllMain, and that gives me a result of zero - failure. I also tried without this.

AvisynthPluginInit2 is being called from my DLL (I can stop it here in the debugger), but the "Create" method that I've defined for my function is not.

When you say "install the required runtime libraries" is there something I need to do to register them with the OS like in the GAC?

xlat808
19th April 2011, 20:01
It turns out the FFTW DLL had to be in the same directory as the SCRIPT, not the plugins directory (next to my DLL).

Thanks for your help. You got me going in the right direction.
:thanks:

Gavino
19th April 2011, 20:24
It turns out the FFTW DLL had to be in the same directory as the SCRIPT, not the plugins directory (next to my DLL).
That's because during script loading, the current directory is set to the script directory. An alternative is to put it in a folder (directory) that is on your PATH environment variable, then it is available independently of your script location. Normally one would put it in C:\Windows\System32.