Compile and link source files against MATLAB generated shared libraries
Some of these options (
-v) are available on the
line and are passed along to
mbuild. Others can
be passed along using the
-M option to
For details on the
-M option, see the
mcc reference page.
Supported types of source files are:
mbuild that are not options
and do not belong to one of the supported source file types are assumed
to be library names, and are passed to the linker.
This table lists the set of
If no platform is listed, the option is available on both UNIX® and Windows®.
(Windows only) Include the contents of the text
Build an output file for architecture
Compile only. Creates an object file only.
Define a symbol name to the C preprocessor. Equivalent
Define a symbol name and value to the C preprocessor.
Equivalent to a
Specify location and name of options file to use. Overrides
Create an executable containing additional symbolic information
for use in debugging. This option disables the
Print help for
Link with object library. On Windows systems,
When linking with a library, it is essential that you first
specify the path (with
No execute mode. Print out any commands that
Optimize the object code. Optimization is enabled by
default and by including this option on the command line. If the
Place all output files in folder
Create an executable named
Interactively specify the C/C++ compiler options file
to use as the default for future invocations of
Interactively specify the COM compiler options file to
use as the default for future invocations of
Remove any initial definition of the C preprocessor symbol
Verbose mode. Print the values for important internal variables after the options file is processed and all command line arguments are considered. Prints each compile step and final link step fully evaluated.
Supplement or override an options file variable for variable
It is common to use this option to supplement
a variable already defined. To do this, refer to the variable by prepending
For the MinGW-w64 compiler, which is based on gcc/g++, use single quotes
To change the default C/C++ compiler for use with MATLAB Compiler SDK™, use
To compile and link an external C program
mbuild foo.c -L. -lfoo (on UNIX) mbuild foo.c libfoo.lib (on Windows)
This assumes both
foo.c and the library generated
above are in the current working folder.