error using loadlibrary on delcom.dll/.h - any idea why this is not working?
조회 수: 5 (최근 30일)
이전 댓글 표시
I am trying to communicate with a delcom USB product. I downloaded the .dll and the .h from their website: https://www.delcomproducts.com/productdetails.asp?ProductNum=890510
I downloaded the zip file and renamed the files for convenience to delcom.dll and delcom.h
issued:
loadlibrary('delcom.dll','delcom.h'
i get over 100 errors that look similar to this:
Error using loadlibrary
Building delcom_thunk_pcwin64 failed. Compiler output is:
cl -I"C:\Program Files\MATLAB\R2018a\extern\include" /Zp8 /W3 /nologo
-I"E:\support_Matlab\DelCom"
-I"E:\support_Matlab\DelCom"
"delcom_thunk_pcwin64.c" -LD -Fe"delcom_thunk_pcwin64.dll"
delcom_thunk_pcwin64.c
E:\support_Matlab\DelCom\delcom.h(44) : error C2061:
syntax error : identifier 'SHORT'
E:\support_Matlab\DelCom\delcom.h(46) : error C2059:
syntax error : '}'
E:\support_Matlab\DelCom\delcom.h(55) : error C2016:
C requires that a struct or union has at least one member
E:\support_Matlab\DelCom\delcom.h(55) : error C2061:
syntax error : identifier 'HANDLE'
E:\support_Matlab\DelCom\delcom.h(56) : error C2061:
syntax error : identifier 'DType'
E:\support_Matlab\DelCom\delcom.h(56) : error C2059:
syntax error : ';'
E:\support_Matlab\DelCom\delcom.h(58) : error C2059:
I have successfully used loadlibrary with other dll's.
Does anyone have any idea why it will not work with this particular DLL?
thank you for any insight
댓글 수: 0
답변 (2개)
Philip Borghesani
2018년 11월 2일
It appears that delcom.h requires a #include of windows.h. This answer has more information. There are also other answers by me that contain ways to work around the issue.
If you can't figure it out add a comment here with any progress you have made.
참고 항목
카테고리
Help Center 및 File Exchange에서 C Shared Library Integration에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!