error using loadlibrary on delcom.dll/.h - any idea why this is not working?
1 view (last 30 days)
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
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
"delcom_thunk_pcwin64.c" -LD -Fe"delcom_thunk_pcwin64.dll"
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
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.