|
hi, all
I write a plugin A.mll, and it depends on project B.
B is an open source project, and it can generate B.dll.and B.lib.
Case 1:
I link B.lib in my project(MSVC2005), A.mll depends on B.dll. (I check A.mll by a dll viewer, and find that A.mll uses serveal functions in B.dll )
Then, I import A.mll in maya PluginManager, and it complains:
// Error: file: D:/Maya2009ROOT/scripts/others/pluginWin.mel line 663:
Unable to dynamically load : E:/MyProjectRoot/A.mll
The specified module could not be found.
The complains still exists even i put B.dll into Maya2009ROOT\bin\plug-ins\B\ .
Case2:
I include source code of B project and don’t link B.lib in my project(MSVC2005) . This time, A.mll doesn’t depend on B.dll anymore, I’m sure of this by the dll viewer.
This time, A.mll can be imported in maya. Every thing is fine.
But how to solve the problem in Case 1? Assuming that B is not open source, and my project depends on B.dll and B.lib.
Thanks in advance.
|
|
|
|
The search for DLL dependencies usually follow this order:
1. The directory from which the application loaded.
2. The system directory. Use the GetSystemDirectory function to get the path of this directory.
3. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
4. The current directory.
5. The directories that are listed in the PATH environment variable.
Just for testing, remove the dependency for your .DLLs and call GetCurrentDirectory() to see
where Maya is currently looking. Place all DLLs there. This is just a hack and probably won’t always work.
Another way to solve your problem, use LoadLibrary to load your .DLL. Then, before loading it,
use the SetCurrentDirectory() to set it where your plugin is located.
|
|
|
|
I have the same problem but it is comes when i try to load a plugin, “Unable to dynamically load: “
|
|
|
|
I solved this problem by put B.dll to MayaRoot\bin directory. But i don’t think this is the best solution.
|
|
|