MindRove / MindRoveSDK

Apache License 2.0
5 stars 4 forks source link

[MATLAB] Error in Get Data from a Board #5

Closed Iqra-Karim closed 2 months ago

Iqra-Karim commented 1 year ago

I am testing the get data from a board sample code on Matlab but I'm getting the following errors and warnings. What could be the issue and how to resolve it?

kfbif Warning: Message from C preprocessor: D:\MindRoveSDK-main\win\inc\board_controller.h:1:9: warning: #pragma once in main file

pragma once

^~~~

In loadlibrary In BoardShim.load_lib (line 14) In BoardShim.set_log_file (line 57) In kfbif (line 1) 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 In BoardShim.load_lib (line 14) In BoardShim.set_log_file (line 57) In kfbif (line 1) Error loading library intermediate output follows. The actual error is at the end of this output.


Unescaped left brace in regex is deprecated here (and will be fatal in Perl 5.30), passed through in regex; marked by <-- HERE in m/struct([^;,{(]){ <-- HERE (.?)}([^;])*;/ at D:\MATLAB\toolbox\matlab\general\private\prototypes.pl line 912.

Failed to parse type '( cdecl )) release_all_sessions (' original input '( cdecl )) release_all_sessions (' Found on line 85 of input from line 31 of file D:\MindRoveSDK-main\win\inc\board_controller.h Error parsing argument for function attribute function may be invalid.

Failed to parse type '( cdecl )) set_log_level_board_controller ( int log_level' original input '( cdecl )) set_log_level_board_controller ( int log_level ' Found on line 88 of input from line 34 of file D:\MindRoveSDK-main\win\inc\board_controller.h Error parsing argument for function attribute function may be invalid.

Failed to parse type '( cdecl )) set_log_file_board_controller ( char log_file' original input '( cdecl )) set_log_file_board_controller ( const char log_file ' Found on line 89 of input from line 35 of file D:\MindRoveSDK-main\win\inc\board_controller.h Error parsing argument for function attribute function may be invalid.

Type 'JNINativeInterfacePtr' was not found. Defaulting to type voidPtr.

Found on line 94 of input from line 40 of file D:\MindRoveSDK-main\win\inc\board_controller.h

Failed to parse type '( cdecl )) java_set_jnienv ( JNIEnv java_jnienv' original input '( cdecl )) java_set_jnienv ( JNIEnv java_jnienv ' Found on line 95 of input from line 41 of file D:\MindRoveSDK-main\win\inc\board_controller.h Error parsing argument for function attribute function may be invalid.


Error using loadlibrary Building BoardController_thunk_pcwin64 failed. Compiler output is: C:\ProgramData\MATLAB\SupportPackages\R2019a_1\3P.instrset\mingw_w64.instrset\bin\gcc -I"D:\MATLAB\extern\include" -fexceptions -fno-omit-frame-pointer -I"C:\Users\user\Desktop" -I"D:\MindRoveSDK-main\win\inc" "BoardController_thunk_pcwin64.c" -o "BoardController_thunk_pcwin64.dll" -shared BoardController_thunk_pcwin64.c: In function 'int32': BoardController_thunk_pcwin64.c:54:41: error: expected declaration specifiers before ')' token EXPORT_EXTERN_C int32_T int32(cdecl))release_all_sessions(Thunk(void fcn(),const char *callstack,int stacksize) ^ BoardController_thunk_pcwin64.c:5:26: error: expected declaration specifiers before 'attribute'

define DLL_EXPORT_SYM __declspec(dllexport)

                      ^

BoardController_thunk_pcwin64.c:19:25: note: in expansion of macro 'DLL_EXPORT_SYM'

define EXPORT_EXTERN_C DLL_EXPORT_SYM

                     ^~~~~~~~~~~~~~

BoardController_thunk_pcwin64.c:63:1: note: in expansion of macro 'EXPORT_EXTERN_C' EXPORT_EXTERN_C int32_T int32(cdecl))set_log_level_board_controller(intlog_levelThunk(void fcn(),const char *callstack,int stacksize) ^~~~~~~ BoardController_thunk_pcwin64.c:5:26: error: expected declaration specifiers before 'attribute'

define DLL_EXPORT_SYM __declspec(dllexport)

                      ^

BoardController_thunk_pcwin64.c:19:25: note: in expansion of macro 'DLL_EXPORT_SYM'

define EXPORT_EXTERN_C DLL_EXPORT_SYM

                     ^~~~~~~~~~~~~~

BoardController_thunk_pcwin64.c:72:1: note: in expansion of macro 'EXPORT_EXTERN_C' EXPORT_EXTERN_C int32_T int32(cdecl))set_log_file_board_controller(charlog_fileThunk(void fcn(),const char callstack,int stacksize) ^~~~~~~ BoardController_thunk_pcwin64.c:5:26: error: expected declaration specifiers before 'attribute'

define DLL_EXPORT_SYM __declspec(dllexport)

                      ^

BoardController_thunk_pcwin64.c:19:25: note: in expansion of macro 'DLL_EXPORT_SYM'

define EXPORT_EXTERN_C DLL_EXPORT_SYM

                     ^~~~~~~~~~~~~~

BoardController_thunk_pcwin64.c:81:1: note: in expansion of macro 'EXPORT_EXTERN_C' EXPORT_EXTERN_C int32_T int32(cdecl))java_set_jnienv(JNIEnvjava_jnienvThunk(void fcn(),const char callstack,int stacksize) ^~~~~~~ BoardController_thunk_pcwin64.c:54:25: warning: type of 'cdecl' defaults to 'int' [-Wimplicit-int] EXPORT_EXTERN_C int32_T int32(cdecl))release_all_sessions(Thunk(void fcn(),const char *callstack,int stacksize) ^~~~~ BoardController_thunk_pcwin64.c:87:1: error: expected '{' at end of input } ^

Error in BoardShim.load_lib (line 14) loadlibrary('BoardController.dll', 'board_controller.h', 'addheader', 'board_info_getter');

Error in BoardShim.set_log_file (line 57) lib_name = BoardShim.load_lib();

Error in kfbif (line 1) BoardShim.set_log_file('mindrove.log');

MelindaRacz commented 1 year ago

Dear @Iqra-Karim, Thank you for reporting the error. To me, it seems you use MinGW compiler that is not compatible with MindRove SDK. Try using Visual C++ instead. Best regards, Melinda Rácz