Error finding the DLL in the final build
Hi, guys.
I'm building a little test extension here and I'm having a problem. I use an external DLL file and I configured the linker to point to the DLL's lib. In edit time, everything runs fine if I put the DLL in either:
1) System32 folder;
2) Data/Runtime folder;
3) MMF2 main folder;
But when I build the application, I'd like to make it run with DLL being in the same folder as the built application. But the extension refuses to load stating that an external library is missing. Again, if I put the DLL into System32 folder, it works flawlessly.
Do you guys know what could be causing this? Perhaps some linker option I did not set(I'm not too experienced with Visual C++)?
Thank you for your time.
Re: Error finding the DLL in the final build
MMF extracts the EXE your extension will run from to a temporary folder before executing it. You need to implement the GetDependencies function (General.cpp).
Re: Error finding the DLL in the final build
As soon as I get home, I'll do as you adviced.
Thank you, Jamie.
Re: Error finding the DLL in the final build
Hmm... after editing the code to this:
Code:
LPCSTR* WINAPI DLLExport GetDependencies()
{
// Do some rSDK stuff
#include "rGetDependencies.h"
LPCSTR szDep[] = {
"sqlite3.dll", NULL
};
return szDep;
}
...I get an error message while building the application in MMF2:
Quote:
D:\Arquivos de Programas\Multimedia Fusion 2\Data\Runtime\□ contains an invalid path.
The DLL is both inside MMF2 main directory and in the Runtime folder as well.
What am I doing wrong?
Re: Error finding the DLL in the final build
Take out the NULL at the end.
Re: Error finding the DLL in the final build
I've been trying several ways. This:
Code:
LPCSTR szDep[] = {
"sqlite3.dll"
};
will show this message:
Quote:
D:\Arquivos de Programas\Multimedia Fusion 2\Data\Runtime\™UP was no found.
Thank you for your help so far. :/
Re: Error finding the DLL in the final build
I figured it out, Jamie.
I had to move the variable declaration and association of szDep outside of the GetDependencies function. Visual C++ kept complaining about returning pointers to local variables. You might want to update your General.cpp. It took me hundreds of compilation tries before realising. Thank you for all your kind help. :)
Re: Error finding the DLL in the final build
Yeah, the method I showed here has szDep outside of the function for just that reason.
Re: Error finding the DLL in the final build
Wow, how didn't I spot that? :)
Yes, I will update it in rSDK.