loadlibrary doesn't load all functions from dll
조회 수: 8 (최근 30일)
이전 댓글 표시
Hello there, I'm trying to load a dll file into Matlab using loadlibrary, but so far I'm only able to load the first 4 functions listed in the .h file that associates with the .dll file. There are over a hundred functions. I did received a couple warnings on the nonexistence of the 'error' data type, which I suppressed with this method ( http://www.mathworks.com/matlabcentral/answers/259-warnings-returned-by-loadlibrary). So when I deleted the first 4 functions from the .h file the loadlibrary function doesn't work. So I'm not sure if this has to do with the composition of the .h file (which I don't think is problematic) or there are some caveats that I didn't realize when I use the loadlibrary function? Below is the code that I wrote,
warning off MATLAB:loadlibrary:TypeNotFound
warning off MATLAB:loadlibrary:TypeNotFoundForStructure
tec5_libfile = ['C:\Program Files\...dll'];
tec5_hfile = ['C:\Program Files\...h'];
[tec5_notfound, tec5_warnings] = loadlibrary(tec5_libfile,tec5_hfile);
libfunctions SDACQ32MP
I ignored the accurate addresses. They are correctly typed in my code, otherwise the function wouldn't work.
댓글 수: 1
Philip Borghesani
2012년 3월 1일
More information is needed before any useful solutions can be proposed. What are the exact messages output? What are the contents of tec5_warnings? If this is huge show us the begging of it. Can you post part of the header file with functions that work and those that do not? Are the missing functions in tec5_notfound or just plain missing? Can you supply information or a link to the documentation for the library you are attempting to load?
I suggest not disabling any warnings until you can successfully use the library and you know the warnings are not relevant.
답변 (1개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Language Support에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!