Building error of status code 2 in matlab mex
I encounter a building error in compiling a .m file into .mexmaci64. My matlab version is 2011a, platform Mac OS X 10.6, using a Xcode 3.2.
Error statement:
??? Build error: Compilation returned error status code 2. See the target build log for further details.
Target build log:
3 In file included from mphmm_getEstimation_data.c:13: 4 mphmm_getEstimation_data.h:30: error: expected '=', ',', ';', 'asm' or 'attribute' before 'xb_emlrtRSI' 5 mphmm_getEstimation_data.h:31: error: expected '=', ',', ';', 'asm' or 'attribute' before 'nc_emlrtRSI' 6 mphmm_getEstimation_data.h:32: error: expected '=', ',', ';', 'asm' or 'attribute' before 'oc_emlrtRSI' 7 mphmm_getEstimation_data.h:33: error: expected '=', ',', ';', 'asm' or 'attribute' before 'pc_emlrtRSI' 8 mphmm_getEstimation_data.h:34: error: expected '=', ',', ';', 'asm' or 'attribute' before 'qc_emlrtRSI' 9 mphmm_getEstimation_data.c:22: error: expected '=', ',', ';', 'asm' or 'attribute' before 'xb_emlrtRSI' 10 mphmm_getEstimation_data.c:23: error: expected '=', ',', ';', 'asm' or 'attribute' before 'nc_emlrtRSI' 11 mphmm_getEstimation_data.c:24: error: expected '=', ',', ';', 'asm' or 'attribute' before 'oc_emlrtRSI' 12 mphmm_getEstimation_data.c:25: err开发者_如何学运维or: expected '=', ',', ';', 'asm' or 'attribute' before 'pc_emlrtRSI' 13 mphmm_getEstimation_data.c:26: error: expected '=', ',', ';', 'asm' or 'attribute' before 'qc_emlrtRSI' 14 gmake: * [mphmm_getEstimation_data.o]
I highly appreciate if someone can tell me how to solve the error. Please let me know if I need to provide code file. Sorry that I am not professional on this.
I've solved the problem. It is a linking error, caused by either some linking arguments are missing or some .h files are missing. It turned out that
mwmathutils.h
and
emlrt.h
are out of date for my current matlab version. I replaced the two files, and everything started to work.
精彩评论