@gili wrote:
Hello all,
I have a problem. I created a dll in matlab and want to use it in LV (the matlab function is wrapped by C function).
When
I try to run it where no matlab installed, I have errors that some dlls
not found even so I copyed those dlls to the same directory.
If I call this dll from C it works without any problem. My conclusion is that the LV search in the wrong place.
does anyone have any idea how to solve this problem.
thank you
Gil Agmon
The
primary DLL is searched by LabVIEW at the path you specify when
configuring the Call Library Node. After that it passes the request to
Windows to let it handle the search.
Windows will search in floolowing locations and in that order:
1) already loaded into process memory space -> use it
2) the directory where the executable resides asking for the dll, e.g. where Labview.exe sits
3) the windows directory
4) the system directory
5) any directory that appears in the PATH environment variable
However your primary DLL can and will load other DLLs. LabVIEW has no
control about how the DLL will load those secondary DLLs. Typically
this will be done through link libraries implicitedly in which case
above Windows rules apply, but a DLL could decide to locate certain
other DLLs dynamically themselves based on fixed paths (very bad idea)
or on information in the registry (does happen regularly).
A single implicitedly linked DLL that Windows can not find will without
any possibility for you to interact simply fail the entire loading of
the primary DLL.
In respect to matlab DLLs I'm quite sure that you need at least the matlab runtime installed for matlab DLLs to work at all.
Rolf Kalbermatter
Rolf Kalbermatter
My Blog 
DEMO, Electronic and Mechanical Support department, room 36.LB00.390