mex with MATLAB2013a Unrecognized switch: -o

自古美人都是妖i 提交于 2019-11-27 07:10:12

问题


I am trying to run a code which compiles some c++ codes using mex. I have set up mex with Microsoft Visual C++ 2010. But when I execute the line

mex -O fconv.cc -o fconv

I get the error

compile
    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\R2011A\BIN\MEX.PL: Error: Unrecognized switch: -o. 

I have googled a lot but couldn't find anything of use. It would be great if you someone could help me out here. I have very limited knowledge of using mex.


回答1:


From the R2013a docs for mex (and current version), there is no -o option, but there is -output:

-output resultname Create binary MEX-file named resultname. Automatically appends the appropriate MEX-file extension. Overrides the default MEX-file naming mechanism.

BTW, the big O option (-O) is on by default unless you use -g.

Keep in mind that mex is not a compiler, but a frontend to the compiler. It has very different syntax from what you might be used to for a compiler.



来源:https://stackoverflow.com/questions/25813939/mex-with-matlab2013a-unrecognized-switch-o

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!