c++ - mex 编译错误 : Unrecognized switch: -cxx

标签 c++ matlab mex

编译mex文件时出现上述错误。我将 MATLAB2013 与 mex 编译器一起使用:Microsoft SDK 7.1。我希望编译器打印的以下调试信息可能有用:

vl_compilenn: * Compiler and linker configurations *
vl_compilenn:   intermediate build products directory: 
C:\Dima  \Projects_C   \Libraries\matconvnet\matlab\mex\.build
vl_compilenn:   MEX files: C:\Dima\Projects_C\Libraries\matconvnet\matlab
\mex/
vl_compilenn:   MEX compiler options: -DNDEBUG -D__SSSE3__ -cxx
vl_compilenn:   MEX linker options: -lmwblas -lgdiplus
vl_compilenn: * Reading images *
vl_compilenn:   vl_imreadjpeg enabled
vl_compilenn:   image library: gdiplus
vl_compilenn:   image library compile flags: 
vl_compilenn:   image library link flags: -lgdiplus
vl_compilenn: MEX: -outdir C:\Dima\Projects_C\Libraries\matconvnet\matlab
\mex\.build matlab\src\vl_imreadjpeg.cpp -c -DNDEBUG -D__SSSE3__ -cxx
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\R2013A\BIN\MEX.PL: Error: Unrecognized switch: -cxx

最佳答案

这是 -cxx MEX 命令行选项的帮助:

Command Line Options Available Only on UNIX Platforms:
    -cxx
        Use the C++ linker to link the mex-file if the first source file 
        is in C and there are one or more C++ source or object files. This 
        option overrides the assumption that the first source file in 
        the list determines which linker to use.

如您所见,它表示 -cxx 仅在 UNIX 平台上可用。我认为您不需要做任何特殊的事情来在 Windows 上编译 C++ MEX;只需像以前那样调用 mex,但不要使用 -cxx。

关于c++ - mex 编译错误 : Unrecognized switch: -cxx,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29600987/

相关文章:

c++ - 将 float * 或 int * 分配给 mxArray

c++ - 如何在 C++ 字符串中搜索非 ASCII 字符?

c++ - 稀疏建模软件编译错误

c++ - 错误 LNK2019 : unresolved external symbol

matlab - 是否有可以像 VBA 的 IIF 一样内联放置的 Matlab 条件 IF 运算符

arrays - 在 Matlab 中用矩阵索引多维数组

c# - 从 .Net 调用 Matlab 对象的(目录)方法

java - 这种情况的抽象语法树?

java - Superpowered:将效果应用于音频后,是否可以将输出缓冲区保存到文件中?

c++ - 了解 OOP 关联和函数 (c++)