Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Development

Reply
 
Thread Tools Search this Thread Display Modes
Old 18th April 2011, 20:20   #1  |  Link
xlat808
Registered User
 
Join Date: Mar 2011
Posts: 3
LoadPlugin: unable to load

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.
xlat808 is offline   Reply With Quote
Old 19th April 2011, 00:15   #2  |  Link
IanB
Avisynth Developer
 
Join Date: Jan 2003
Location: Melbourne, Australia
Posts: 3,167
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.
IanB is offline   Reply With Quote
Old 19th April 2011, 16:32   #3  |  Link
xlat808
Registered User
 
Join Date: Mar 2011
Posts: 3
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 is offline   Reply With Quote
Old 19th April 2011, 20:01   #4  |  Link
xlat808
Registered User
 
Join Date: Mar 2011
Posts: 3
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.
xlat808 is offline   Reply With Quote
Old 19th April 2011, 20:24   #5  |  Link
Gavino
Avisynth language lover
 
Join Date: Dec 2007
Location: Spain
Posts: 3,431
Quote:
Originally Posted by xlat808 View Post
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.
__________________
GScript and GRunT - complex Avisynth scripting made easier
Gavino is offline   Reply With Quote
Reply

Tags
debugging, error, plugin, vs2010

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 22:20.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.