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

在将.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版本来说,已经过时了。我替换了两个文件,一切开始工作。

https://stackoverflow.com/questions/6405078/

相关文章:

java - 帮助通过 JSNI 调用传递复杂对象以绕过静态范围

build - 在Mac OS X Lion(10.7)上使用XCode 4.1和iOS 4.3生成

c++ - C++ map : expected initializer before ‘<’ to

android - “Conversion to Dalvik format failed”错误不会

visual-studio-2010 - Visual Studio/TFS 2010/获取最新版本

macos - 编译GLUT程序

c# - 如何从CMD(Shell)编译测试类和 Entity Framework Model.De

vb.net - 无法在Visual Studio中进行调试

iphone - iOS启动画面导致问题

c++-cli - libcurl编译和链接器错误