Error calling loadlibrary: "functions not found"
Ältere Kommentare anzeigen
I'm trying to automate a device using Matlab through calling a dll file provided by the manufacturer. However, it kept returning errors saying "functions not found", even after I checked with "libisloaded" and Matlab returns 1. Here is the code and error messages:
>> fullpathToDll='C:\D4100_DLLHeaders\D4100_usb.dll'
fullpathToDll =
C:\D4100_DLLHeaders\D4100_usb.dll
>> header1='C:\D4100_DLLHeaders\D4100_usb';
>> header2='C:\D4100_DLLHeaders\resource.h';
>> header3='C:\D4100_DLLHeaders\devioctl.h';
>> header4='C:\D4100_DLLHeaders\ezusbsys.h';
>> header5='C:\D4100_DLLHeaders\main.h';
>> header6='C:\D4100_DLLHeaders\RegisterDefines.h';
[notfound,warnings]=loadlibrary(fullpathToDll,header1,'addheader',header2,'addheader',header3,'addheader',header4,'addheader',header5,'addheader',header6);
Warning: Message from C preprocessor:
lcc preprocessor warning: C:\D4100_DLLHeaders\main.h:173 C:\D4100_DLLHeaders\D4100_usb.h:19 EOF inside comment
lcc preprocessor warning: C:\D4100_DLLHeaders\RegisterDefines.h:40 C:\D4100_DLLHeaders\D4100_usb.h:23 EOF inside comment
lcc preprocessor warning: C:\D4100_DLLHeaders\D4100_usb.h:69 EOF inside comment
> In loadlibrary at 266
Warning: Warnings messages were produced while parsing. Check the functions you
intend to use for correctness. Warning text can be viewed using:
[notfound,warnings]=loadlibrary(...)
> In loadlibrary at 275
Warning: The function 'bOpenDriver' was not found in the library
> In loadlibrary at 319
Warning: The function 'ParseDeviceDescriptor' was not found in the library
> In loadlibrary at 319
Warning: The function 'ParseConfigurationDescriptor' was not found in the library
> In loadlibrary at 319
Warning: The function 'DumpBuffer' was not found in the library
> In loadlibrary at 319
Warning: No functions found in library.
> In loadlibrary at 327
The functions that give the warnings are from 'main.h'. What's causing the problems? Is there something wrong with the header files? I got those from the manufacturer and they have verified that the files work on LabView but have not tested them in Matlab.
Could someone help me solve this problem? Thanks!!
Siqi
Antworten (2)
Image Analyst
am 30 Mär. 2015
0 Stimmen
Did you run Dependency Walker (Google it) on your DLL to see what functions it actually has in it?
5 Kommentare
Siqi Li
am 30 Mär. 2015
Image Analyst
am 30 Mär. 2015
You might have to make a prototype file. See attached demo. Adapt as needed or ask the Mathworks. I'm no expert - I just did it once for a particular file and it's not something I do regularly.
Siqi Li
am 31 Mär. 2015
Siqi Li
am 7 Apr. 2015
Image Analyst
am 7 Apr. 2015
I don't really know - I've only had to do it once. I think you should just call them and ask them. Might as well get some support from them considering the huge amount of money you had to pay for the compiler toolbox.
Kategorien
Mehr zu MATLAB Compiler finden Sie in Hilfe-Center und File Exchange
Produkte
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!