I was trying to utilize a different kernel to the linear kernel and as a result was trying to create the MEX file for the libsvmpredict.c function. When I ran the code for creating the mex file from the libsvm_compile.m file, I encountered the following error:
In file included from libsvmpredict.c:4:0:
svm.h:49:1: error: expected identifier or ‘(’ before ‘/’ token
svm.h:97:1: error: expected identifier or ‘(’ before ‘/’ token
libsvmpredict.c: In function ‘read_sparse_instance’:
libsvmpredict.c:25:2: error: expected expression before ‘/’ token
libsvmpredict.c: In function ‘predict’:
libsvmpredict.c:52:21: error: expected expression before ‘/’ token
libsvmpredict.c:63:2: error: expected expression before ‘/’ token
libsvmpredict.c:85:2: error: expected expression before ‘/’ token
libsvmpredict.c:126:3: error: expected expression before ‘/’ token
libsvmpredict.c:129:3: error: expected ‘}’ before ‘else’
libsvmpredict.c: At top level:
libsvmpredict.c:132:2: error: expected identifier or ‘(’ before ‘else’
libsvmpredict.c:143:2: warning: data definition has no type or storage class [enabled by default]
libsvmpredict.c:143:30: error: ‘plhs’ undeclared here (not in a function)
libsvmpredict.c:144:2: warning: data definition has no type or storage class [enabled by default]
libsvmpredict.c:145:2: warning: data definition has no type or storage class [enabled by default]
libsvmpredict.c:146:2: warning: data definition has no type or storage class [enabled by default]
libsvmpredict.c:146:32: error: ‘feature_number’ undeclared here (not in a function)
libsvmpredict.c:147:2: error: expected identifier or ‘(’ before ‘for’
libsvmpredict.c:147:37: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘<’ token
libsvmpredict.c:147:76: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘++’ token
libsvmpredict.c:210:2: error: expected identifier or ‘(’ before ‘if’
libsvmpredict.c:218:2: error: expected identifier or ‘(’ before ‘else’
libsvmpredict.c:222:2: error: expected identifier or ‘(’ before ‘/’ token
libsvmpredict.c:224:2: warning: data definition has no type or storage class [enabled by default]
libsvmpredict.c:225:2: warning: data definition has no type or storage class [enabled by default]
libsvmpredict.c:225:2: error: conflicting types for ‘ptr’
libsvmpredict.c:224:2: note: previous definition of ‘ptr’ was here
libsvmpredict.c:225:19: error: ‘correct’ undeclared here (not in a function)
libsvmpredict.c:225:27: error: ‘total’ undeclared here (not in a function)
libsvmpredict.c:226:2: warning: data definition has no type or storage class [enabled by default]
libsvmpredict.c:226:2: error: conflicting types for ‘ptr’
libsvmpredict.c:224:2: note: previous definition of ‘ptr’ was here
libsvmpredict.c:226:11: error: ‘error’ undeclared here (not in a function)
libsvmpredict.c:227:2: warning: data definition has no type or storage class [enabled by default]
libsvmpredict.c:227:2: error: conflicting types for ‘ptr’
libsvmpredict.c:224:2: note: previous definition of ‘ptr’ was here
libsvmpredict.c:227:19: error: ‘sumpt’ undeclared here (not in a function)
libsvmpredict.c:227:25: error: ‘sump’ undeclared here (not in a function)
libsvmpredict.c:227:30: error: ‘sumt’ undeclared here (not in a function)
libsvmpredict.c:228:13: error: ‘sumpp’ undeclared here (not in a function)
libsvmpredict.c:228:37: error: ‘sumtt’ undeclared here (not in a function)
libsvmpredict.c:230:2: warning: data definition has no type or storage class [enabled by default]
libsvmpredict.c:230:2: warning: parameter names (without types) in function declaration [enabled by default]
libsvmpredict.c:230:2: error: conflicting types for ‘free’
libsvmpredict.c:231:2: error: expected identifier or ‘(’ before ‘if’
libsvmpredict.c:233:1: error: expected identifier or ‘(’ before ‘}’ token
libsvmpredict.c: In function ‘mexFunction’:
libsvmpredict.c:273:3: error: expected expression before ‘/’ token
libsvmpredict.c:333:3: error: expected expression before ‘/’ token
I'm using a 64 bit Ubuntu 14.04 system. Can some one tell me why this error has come up?
I was trying to utilize a different kernel to the linear kernel and as a result was trying to create the MEX file for the libsvmpredict.c function. When I ran the code for creating the mex file from the libsvm_compile.m file, I encountered the following error:
In file included from libsvmpredict.c:4:0: svm.h:49:1: error: expected identifier or ‘(’ before ‘/’ token svm.h:97:1: error: expected identifier or ‘(’ before ‘/’ token libsvmpredict.c: In function ‘read_sparse_instance’: libsvmpredict.c:25:2: error: expected expression before ‘/’ token libsvmpredict.c: In function ‘predict’: libsvmpredict.c:52:21: error: expected expression before ‘/’ token libsvmpredict.c:63:2: error: expected expression before ‘/’ token libsvmpredict.c:85:2: error: expected expression before ‘/’ token libsvmpredict.c:126:3: error: expected expression before ‘/’ token libsvmpredict.c:129:3: error: expected ‘}’ before ‘else’ libsvmpredict.c: At top level: libsvmpredict.c:132:2: error: expected identifier or ‘(’ before ‘else’ libsvmpredict.c:143:2: warning: data definition has no type or storage class [enabled by default] libsvmpredict.c:143:30: error: ‘plhs’ undeclared here (not in a function) libsvmpredict.c:144:2: warning: data definition has no type or storage class [enabled by default] libsvmpredict.c:145:2: warning: data definition has no type or storage class [enabled by default] libsvmpredict.c:146:2: warning: data definition has no type or storage class [enabled by default] libsvmpredict.c:146:32: error: ‘feature_number’ undeclared here (not in a function) libsvmpredict.c:147:2: error: expected identifier or ‘(’ before ‘for’ libsvmpredict.c:147:37: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘<’ token libsvmpredict.c:147:76: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘++’ token libsvmpredict.c:210:2: error: expected identifier or ‘(’ before ‘if’ libsvmpredict.c:218:2: error: expected identifier or ‘(’ before ‘else’ libsvmpredict.c:222:2: error: expected identifier or ‘(’ before ‘/’ token libsvmpredict.c:224:2: warning: data definition has no type or storage class [enabled by default] libsvmpredict.c:225:2: warning: data definition has no type or storage class [enabled by default] libsvmpredict.c:225:2: error: conflicting types for ‘ptr’ libsvmpredict.c:224:2: note: previous definition of ‘ptr’ was here libsvmpredict.c:225:19: error: ‘correct’ undeclared here (not in a function) libsvmpredict.c:225:27: error: ‘total’ undeclared here (not in a function) libsvmpredict.c:226:2: warning: data definition has no type or storage class [enabled by default] libsvmpredict.c:226:2: error: conflicting types for ‘ptr’ libsvmpredict.c:224:2: note: previous definition of ‘ptr’ was here libsvmpredict.c:226:11: error: ‘error’ undeclared here (not in a function) libsvmpredict.c:227:2: warning: data definition has no type or storage class [enabled by default] libsvmpredict.c:227:2: error: conflicting types for ‘ptr’ libsvmpredict.c:224:2: note: previous definition of ‘ptr’ was here libsvmpredict.c:227:19: error: ‘sumpt’ undeclared here (not in a function) libsvmpredict.c:227:25: error: ‘sump’ undeclared here (not in a function) libsvmpredict.c:227:30: error: ‘sumt’ undeclared here (not in a function) libsvmpredict.c:228:13: error: ‘sumpp’ undeclared here (not in a function) libsvmpredict.c:228:37: error: ‘sumtt’ undeclared here (not in a function) libsvmpredict.c:230:2: warning: data definition has no type or storage class [enabled by default] libsvmpredict.c:230:2: warning: parameter names (without types) in function declaration [enabled by default] libsvmpredict.c:230:2: error: conflicting types for ‘free’ libsvmpredict.c:231:2: error: expected identifier or ‘(’ before ‘if’ libsvmpredict.c:233:1: error: expected identifier or ‘(’ before ‘}’ token libsvmpredict.c: In function ‘mexFunction’: libsvmpredict.c:273:3: error: expected expression before ‘/’ token libsvmpredict.c:333:3: error: expected expression before ‘/’ token
I'm using a 64 bit Ubuntu 14.04 system. Can some one tell me why this error has come up?