error using loadlibrary on delcom.dll/.h - any idea why this is not working?
5 views (last 30 days)
Show older comments
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 Comments
Answers (2)
Philip Borghesani
on 2 Nov 2018
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.
See Also
Categories
Find more on C Shared Library Integration in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!