Matlab R2011b mex文件编译错误“无法识别的开关:-argcheck”

时间:2013-01-12 13:40:42

标签: matlab compilation mex

当我尝试在matlab r2011b上编译mex文件时,会出现如下错误。

我该如何解决?

我从http://www.timotheecour.com/software/ncut_multiscale/ncut_multiscale.html下载了代码并编译

我的系统:核心i7 - 64位win7

You can change your home, image, and results directories if you want ; see startup/definePaths
*********************************
Error: compilation of \cimgnbmap_lower.cpp failed :     Usage:
        MEX [option1 ... optionN] sourcefile1 [... sourcefileN]
            [objectfile1 ... objectfileN] [libraryfile1 ... libraryfileN]

    Use the -help option for more information, or consult the MATLAB API Guide.


  C:\PROGRA~1\MATLAB\R2011B\BIN\MEX.PL: Error: Unrecognized switch: -argcheck.


*********************************
....... (same error for other 11 files)


There were 0 files compiled

Error: There were 12 erroneous files during compilation
\cimgnbmap_lower.cpp
\mex_XindicatorTimesX.cpp
\mex_affinity_option.cpp
\mex_computeRowSum.cpp
\mex_constraint_classes.cpp
\mex_extractMaxima.cpp
\mex_istril.cpp
\mex_neighborW.cpp
\mex_normalizeColumns.cpp
\mex_projection_QR_symmetric.cpp
\mex_w_times_x_symmetric_tril.cpp
\spmtimesd.cpp

ans = 

1x12 struct array with fields:
    isErrorDuringCompilation
    isCompilationFailed
    message
    compiledFilename
    file
    isError

1 个答案:

答案 0 :(得分:1)

从MATLAB R2010b中删除了

mex的-argcheck选项。您使用的是哪个版本的MATLAB?如果您认为您的mex文件不希望对API函数进行无效调用,则可以安全地删除此选项。例如,使用NULL指针调用mxGetPr会崩溃。 “-argcheck”会抓住这个并抛出错误。