Error calling loadlibrary: "functions not found"
이전 댓글 표시
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
답변 (2개)
Image Analyst
2015년 3월 30일
0 개 추천
Did you run Dependency Walker (Google it) on your DLL to see what functions it actually has in it?
댓글 수: 5
Siqi Li
2015년 3월 30일
Image Analyst
2015년 3월 30일
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
2015년 3월 31일
Siqi Li
2015년 4월 7일
Image Analyst
2015년 4월 7일
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.
카테고리
도움말 센터 및 File Exchange에서 MATLAB Compiler에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!