loadlibrary failing to load iViewXAPI.dll

2 views (last 30 days)
Amir Tal
Amir Tal on 2 Oct 2016
Answered: Andrew Lynn on 26 Jan 2019
Hi everyone,
I'm a phd student, trying to connect Matlab to an SMI eye-tracking system. SMI has an SDK for working with Matlab, and every session starts with the command:
loadlibrary('iViewXAPI.dll', 'iViewXAPI.h');
I have never worked with loadlibrbary() or any other external (mex related) commands, but installed Microsoft Visual C++ 2012, and it seems to work fine when building the 'getting started' yprime.c. However, when I try to run the above command, I get a barrage of errors (attached here at the bottom).
Does anyone have an idea what can cause this, or mend this? I haven't a clue, but I feel it has to do more with my compiler installation and less with SMI's SDK.
Thanks very much in advance,
Amir
Error using loadlibrary
Building iViewXAPI_thunk_pcwin64 failed. Compiler output is:
cl -I"C:\Program Files\MATLAB\R2015b\extern\include" /W3 /nologo -I"C:\Program Files\MATLAB\R2015b\extern\include"
-I"C:\Program Files\MATLAB\R2015b\simulink\include" /D_CRT_SECURE_NO_DEPRECATE /D_SCL_SECURE_NO_DEPRECATE /D_SECURE_SCL=0
-I"C:\Users\user\Documents\MATLAB\Amir" -I"C:\Program Files (x86)\SMI\iView X SDK\include" "iViewXAPI_thunk_pcwin64.c" -LD
-Fe"iViewXAPI_thunk_pcwin64.dll"
iViewXAPI_thunk_pcwin64.c
C:\Program Files (x86)\SMI\iView X SDK\include\iViewXAPI.h(239) : error C2061: syntax error : identifier 'EyeDataStruct'
C:\Program Files (x86)\SMI\iView X SDK\include\iViewXAPI.h(240) : error C2061: syntax error : identifier 'rightEye'
C:\Program Files (x86)\SMI\iView X SDK\include\iViewXAPI.h(240) : error C2059: syntax error : ';'
C:\Program Files (x86)\SMI\iView X SDK\include\iViewXAPI.h(242) : error C2059: syntax error : '}'
C:\Program Files (x86)\SMI\iView X SDK\include\iViewXAPI.h(263) : error C2061: syntax error : identifier 'EyeDataStruct'
C:\Program Files (x86)\SMI\iView X SDK\include\iViewXAPI.h(264) : error C2061: syntax error : identifier 'rightEye'
C:\Program Files (x86)\SMI\iView X SDK\include\iViewXAPI.h(264) : error C2059: syntax error : ';'
C:\Program Files (x86)\SMI\iView X SDK\include\iViewXAPI.h(266) : error C2059: syntax error : '}'
C:\Program Files (x86)\SMI\iView X SDK\include\iViewXAPI.h(506) : error C2071: 'ImageStruct' : illegal storage class
C:\Program Files (x86)\SMI\iView X SDK\include\iViewXAPI.h(506) : error C2032: 'ImageStruct' : function cannot be member of struct
'ImageStruct'
C:\Program Files (x86)\SMI\iView X SDK\include\iViewXAPI.h(556) : error C2061: syntax error : identifier 'AOIRectangleStruct'
C:\Program Files (x86)\SMI\iView X SDK\include\iViewXAPI.h(561) : error C2059: syntax error : '}'
C:\Program Files (x86)\SMI\iView X SDK\include\iViewXAPI.h(716) : error C2146: syntax error : missing ')' before identifier
'aoiData'
C:\Program Files (x86)\SMI\iView X SDK\include\iViewXAPI.h(716) : error C2061: syntax error : identifier 'aoiData'
C:\Program Files (x86)\SMI\iView X SDK\include\iViewXAPI.h(716) : error C2059: syntax error : ';'
C:\Program Files (x86)\SMI\iView X SDK\include\iViewXAPI.h(716) : error C2059: syntax error : ')'
iViewXAPI_thunk_pcwin64.c(95) : error C2065: 'AOIStruct' : undeclared identifier
iViewXAPI_thunk_pcwin64.c(95) : error C2146: syntax error : missing ';' before identifier 'p0'
iViewXAPI_thunk_pcwin64.c(95) : error C2065: 'p0' : undeclared identifier
iViewXAPI_thunk_pcwin64.c(96) : error C2065: 'p0' : undeclared identifier
iViewXAPI_thunk_pcwin64.c(96) : error C2065: 'AOIStruct' : undeclared identifier
iViewXAPI_thunk_pcwin64.c(96) : error C2143: syntax error : missing ')' before 'const'
iViewXAPI_thunk_pcwin64.c(96) : error C2100: illegal indirection
iViewXAPI_thunk_pcwin64.c(96) : error C2059: syntax error : ')'
iViewXAPI_thunk_pcwin64.c(97) : error C2065: 'p0' : undeclared identifier
iViewXAPI_thunk_pcwin64.c(98) : error C2146: syntax error : missing ')' before identifier 'AOIStruct'
iViewXAPI_thunk_pcwin64.c(98) : error C2065: 'AOIStruct' : undeclared identifier
iViewXAPI_thunk_pcwin64.c(98) : error C2059: syntax error : ')'
iViewXAPI_thunk_pcwin64.c(98) : error C2146: syntax error : missing ';' before identifier 'fcn'
iViewXAPI_thunk_pcwin64.c(98) : warning C4047: 'return' : 'int32_T' differs in levels of indirection from 'int32_T (__cdecl *)()'
iViewXAPI_thunk_pcwin64.c(98) : error C2065: 'p0' : undeclared identifier

Answers (2)

Chris Street
Chris Street on 13 Nov 2017
Hi Amir,
I don't think I'll be able to fully help with your problem, but here's what I think I might be able to contribute. The SDK gives an example of using the function with this structure:
loadlibrary('iViewXAPI.dll', @iViewXAPIHeader);
Not sure if that helps, but maybe that would be worth a go? I'm having my own trouble using it, but at least my error seems to be more intelligible than the stream of errors you're getting
C

Andrew Lynn
Andrew Lynn on 26 Jan 2019
Has anyone found an answer to Amir's question? I'm having the same problem...

Categories

Find more on MATLAB Compiler SDK 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!