Mex with MATLAB2013a Unidentified switch: -o

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

mex -O fconv.cc -o fconv

I am getting 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've googled a lot but haven't found anything useful. It would be great if someone could help me. I have very limited knowledge of using mex.

+3


source to share


1 answer


From the R2013a docs formex

(and current version ), there is no option -o

, but there is -output

:

-output resultname

    Create a MEX binary file named resultname. Automatically adds the appropriate MEX file extension. Overrides the default naming mechanism for MEX files.



By the way, the big O ( -o

) option is on by default if you're not using -g

.

Keep in mind that mex

it is not a compiler, but an interface to the compiler. It has a very different syntax from what you might use for a compiler.

+2


source







All Articles