User`s guide

mcc
7-46
mbuild/mex Options
-f <filename> (Specifying Options File). Use the sp ecif ie d options file when calling
mex or mbuild. T his option a llows you to use different compilers for different
invocations of the MATLAB Comp ile r. This option is a direct pass-through to
the
mex or mbuild script. See “External Interfaces/API” for more information
about using this option with the
mex script.
Note Although this option works as documented, it is sugge sted that you use
mex -setup or mbuild -setup to switch compilers.
-g (Debug Only). Cause mex or mbuild to invoke the C/C++ compil er with the
appropriat e C/C+ + co mpile r op ti ons for debugging.You shoul d sp ecify
-g if you
want to d eb ug the MEX-file or stand-a lone application w ith a de bug ger.
-M "string" (Direct Pass Through). Pass string directly to the mex or mbuild script.
This provides a useful mechanism for defining compile-time options, e.g.,
-M
"-Dmacro=value"
.
Note Multiple -M options do not accumulate; only the last -M option is used.
-z <path> (Specifying Library Paths). Sp eci fy the path t o us e for library and include
files. This op tio n uses the s pecif ie d path for compiler libraries ins te ad of the
path returned by
matlabroot.
Examples Make a C translation and a MEX-file for myfun.m.
mcc -x myfun
Make a C translation and a stand-alone executable for myfun.m.
mcc -m myfun
Make a C++ translation and a stand-alone executable for myfun.m.
mcc -p myfun