matlab - Matlab mex中状态码2的构建错误

标签 matlab compiler-errors mex

在将.m文件编译为.mexmaci64时遇到构建错误。
我的matlab版本是2011a,使用Xcode 3.2,平台为Mac OS X 10.6。

错误陈述:

??? Build error: Compilation returned error status code 2. See the target build log for further details.



目标构建日志:

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: error: 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]



如果有人可以告诉我如何解决错误,我将不胜感激。如果需要提供代码文件,请告诉我。抱歉,我对此并不专业。

最佳答案

我已经解决了问题。这是一个链接错误,由某些链接参数丢失或某些.h文件丢失引起。结果表明

mwmathutils.h





emlrt.h



对于我当前的matlab版本来说,已经过时了。我替换了两个文件,一切开始工作。

关于matlab - Matlab mex中状态码2的构建错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6405078/

相关文章:

matlab - 导出和导入 MATLAB 映射结构

matlab - 如何建立数据流挖掘的滑动窗口模型?

compiler-errors - 如何摆脱属性网格警告?

android - 如何在android/eclipse上设置Jfeinstein10滑动菜单

创建 mxArray 数据并将其从其他函数传递到 Mex 网关函数

c# - NUnit 无法找到程序集,但控制台应用程序可以

visual-studio - 在Visual Studio编辑器中可视化错误位置

c++ - OpenMP 矩阵 vector 乘法仅在一个线程上执行

python - 在 Numpy 中设置 *默认* 数据顺序(C 与 Fortran)

c++ - 从 Matlab 调用 Cpp 项目