Error with loadlibrary to upload DLL file
9 views (last 30 days)
Show older comments
I am currently trying to use loadlibrary to upload a dll into MATLAB and have the following error:
loadlibrary('SLAB_USB_SPI','SLAB_USB_SPI.h')
Warning: Warnings messages were produced while parsing. Check the functions you intend to use for
correctness. Warning text can be viewed using:
[notfound,warnings]=loadlibrary(...)
> In loadlibrary
Error loading library intermediate output follows.
The actual error is at the end of this output.
*********
Type 'char_Null_terminated_Ptr' was not found. Defaulting to type voidPtr.
Found on line 53 of input from line 52 of file C:\\SiliconLabs\\MCU\\CP2130_SDK\\Software\\Library\\SLAB_USB_SPI.h
Type 'char_Null_terminated_Ptr' was not found. Defaulting to type voidPtr.
Found on line 54 of input from line 53 of file C:\\SiliconLabs\\MCU\\CP2130_SDK\\Software\\Library\\SLAB_USB_SPI.h
Type 'int_Out_LPGUID' was not found. Defaulting to type error.
Found on line 418 of input from line 417 of file C:\\SiliconLabs\\MCU\\CP2130_SDK\\Software\\Library\\SLAB_USB_SPI.h
Type 'LPGUID' was not found. Defaulting to type error.
Found on line 421 of input from line 420 of file C:\\SiliconLabs\\MCU\\CP2130_SDK\\Software\\Library\\SLAB_USB_SPI.h
*********
Error using loadlibrary
Building SLAB_USB_SPI_thunk_pcwin64 failed. Compiler output is:
cl -I"C:\Program Files\MATLAB\R2017a\extern\include" /W3 /nologo -I"C:\Program
Files\MATLAB\R2017a\extern\include" -I"C:\Program Files\MATLAB\R2017a\simulink\include"
/DTARGET_API_VERSION=700 /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0
-I"C:\Users\subnets\Documents\MATLAB" -I"C:\SiliconLabs\MCU\CP2130_SDK\Software\Library"
"SLAB_USB_SPI_thunk_pcwin64.c" -LD -Fe"SLAB_USB_SPI_thunk_pcwin64.dll"
SLAB_USB_SPI_thunk_pcwin64.c
C:\SiliconLabs\MCU\CP2130_SDK\Software\Library\SLAB_USB_SPI.h(52) : error C2054: expected '(' to
follow '_Null_terminated_'
C:\SiliconLabs\MCU\CP2130_SDK\Software\Library\SLAB_USB_SPI.h(52) : error C2085: 'LPSTR' : not in
formal parameter list
C:\SiliconLabs\MCU\CP2130_SDK\Software\Library\SLAB_USB_SPI.h(53) : error C2628: '_Null_terminated_'
followed by 'char' is illegal (did you forget a ';'?)
C:\SiliconLabs\MCU\CP2130_SDK\Software\Library\SLAB_USB_SPI.h(53) : error C2085: 'LPCSTR' : not in
formal parameter list
C:\SiliconLabs\MCU\CP2130_SDK\Software\Library\SLAB_USB_SPI.h(73) : error C2085: 'CP213x_DEVICE' :
not in formal parameter list
C:\SiliconLabs\MCU\CP2130_SDK\Software\Library\SLAB_USB_SPI.h(74) : error C2085: 'USB_SPI_STATUS' :
not in formal parameter list
C:\SiliconLabs\MCU\CP2130_SDK\Software\Library\SLAB_USB_SPI.h(146) : error C2085: 'inline' : not in
formal parameter list
Does anyone have any suggestions about how to fix this? I am not sure what could be causing this.
4 Comments
Walter Roberson
on 7 Jun 2017
It has to do with Microsoft's Removable Storage Manager Protocol, which in turn relates to using USB devices.
Answers (0)
See Also
Categories
Find more on Call C from MATLAB 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!