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!