Main Content

mcc Command Line Arguments Grouped by Task

COM Components

OptionDescriptionComment
-u

Registers COM component for current user only on development machine

Valid only for generic COM components and Microsoft® Excel® add-ins (requiring MATLAB® Compiler™)

Deployable Archive

OptionDescriptionComment

-a filename

Add filename to the deployable archive.

None

-C

Directs mcc to not embed the deployable archive in C/C++ and main/Winmain shared libraries and standalone binaries by default.

None

Debugging

OptionDescriptionComment
-g

Generate debugging information.

None

-G

Same as -g

None

-K

Directs mcc to not delete output files if the compilation ends prematurely, due to error.

mcc's default behavior is to dispose of any partial output if the command fails to execute successfully.

-v

Verbose; display compilation steps.

None

-W type

Control the generation of function wrappers.

type = main cpplib:<string> lib:<string> none com:compname,clname,version

-?

Display help message.

None

Dependency Function Processing

OptionDescriptionComment

-a filename

Add filename to the deployable archive.

None

Licenses

OptionDescriptionComment
-Y licensefile

Use licensefile when checking out a MATLAB Compiler license.

The -Y flag works only with the command-line mode.

>>!mcc -m foo.m -Y license.lic

MATLAB Compiler for Excel Add-Ins

OptionDescriptionComment
-b

Generate Excel compatible formula function.

Requires MATLAB Compiler

-u

Registers COM component for current user only on development machine

Valid only for generic COM components and Microsoft Excel add-ins (requiring MATLAB Compiler)

MATLAB Path

OptionDescriptionComment
-I directory

Add folder to search path for MATLAB files.

MATLAB path is automatically included when running from MATLAB, but not when running from a DOS/UNIX® shell.

-N

Clear the path of all but a minimal, required set of folders.

None

-p directory

Add directory to compilation path in an order-sensitive context.

Requires -N option

mbuild

OptionDescriptionComment
-f filename

Use the specified options file, filename, when calling mbuild.

mbuild -setup is recommended.

-M string

Pass string to mbuild.

Use to define compile-time options.

MATLAB Runtime

OptionDescriptionComment

-R option

Specify run-time options for MATLAB Runtime.

option = -nojvm -nodisplay-logfile filename-startmsg -completemsg filename

-S

Create Singleton MATLAB Runtime.

Default for generic COM components. Valid for Microsoft Excel and Java® packages.

Override Default Inputs

OptionDescriptionComment
-B filename[:arg[,arg]]

Replace -B filename on the mcc command line with the contents of filename (bundle).

The file should contain only mcc command-line options. These are MathWorks included options files:

  • -B csharedlib:foo — C shared library

  • -B cpplib:foo — C++ library

Override Default Outputs

OptionDescriptionComment
-d directory

Place output in specified folder.

None

-o outputfile

Specify name of final output file.

Adds appropriate extension

-e

Suppresses appearance of the MS-DOS Command Window when generating a standalone application.

Use -e in place of the -m option. Available for Windows® only. Use with -R option to generate error logging. Equivalent to -W WinMain -T link:exe

The standalone app compiler suppresses the MS-DOS command window by default. To unsuppress it, unselect Do not require Windows Command Shell (console) for execution in the app’s Additional Runtime Settings area.

Wrappers and Libraries

OptionDescriptionComment
-c

Generate C wrapper code.

Equivalent to -T codegen

-l

Macro to create a function library.

Equivalent to -W lib -T link:lib

-m

Macro to generate a standalone application.

Equivalent to -W main -T link:exe

-W type

Control the generation of function wrappers.

type = main cpplib:<string> lib:<string> none com:compname,clname,version