Main Content

mcc Command Arguments Listed Alphabetically

OptionDescriptionComment
-?

Display help message.

Cannot be used in a deploytool app.

-a path

Add path to the deployable archive.

If you specify a folder name, all files in the folder are added. If you use a wildcard (*), all files matching the wildcard are added.

-A arch

Append supported platforms to those detected automatically by the compiler.

Valid only for Python®, C/C++ using the MATLAB® data array API, and Java® targets.

arch = win64, maci64, glnxa64, or all

-b

Generate Excel® compatible formula function.

Requires MATLAB Compiler™ for Excel add-ins. Cannot be used in a deploytool app.

-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)

Cannot be used in a deploytool app.

-c

Suppress compiling and linking of the generated C wrapper code.

Must be used in conjunction with the -l option.

-C

Direct mcc to not embed the deployable archive in generated binaries.

 
-d directory

Place output in specified folder.

The specified folder must already exist. Cannot be used in a deploytool app.
-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 to generate error logging. Equivalent to -W WinMain -T link:exe. Cannot be used in a deploytool app.

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

-f filename

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

mbuild -setup is recommended. Valid for C/C++ shared libraries, COM, and Excel targets.

-g

Generate debugging information.

 
-G

Same as -g.

 

-h filename

Specify a custom help text file.

Display help file contents at runtime using -? or /?. Valid for standalone applications, C/C++ shared libraries, COM, and Excel targets.

-I directory

Add folder to search path for MATLAB files.

 
-j

Automatically convert all .m files to P-files before packaging.

 
-k "file=<key_file_path>;loader=<mex_file_path>"

Specify AES encryption key and MEX-file loader interface to retrieve decryption key at runtime.

If you do not specify any arguments after -k, mcc generates a 256-bit AES key and a loader MEX-file.

-K

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

Default behavior is to dispose of any partial output if the command fails to execute successfully.

-l

Create a function library.

Equivalent to -W lib -T link:lib. Cannot be used in a deploytool app.

-m

Generate a standalone application.

Equivalent to -W main -T link:exe. Cannot be used in a deploytool app.

-M string

Pass string to mbuild.

Use to define compile-time options.

-n

Automatically treat numeric inputs as MATLAB doubles.

Cannot be used in a deploytool app.

-N

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

Uses the following folders:

  • matlabroot\toolbox\matlab

  • matlabroot\toolbox\local

  • matlabroot\toolbox\compiler

  • matlabroot\toolbox\shared\bigdata

-o outputfile

Specify name of final output file.

Adds appropriate extension. Cannot be used in a deploytool app.

-p directory

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

Requires -N option.

-r 'path/to/icon.ico'

Embed resource icon in binary.

 

-R option

Specify run-time options for MATLAB Runtime.

Valid only for standalone applications using MATLAB Compiler.

option = -nojvm, -nodisplay, '-logfile filename', -startmsg, and -completemsg filename

-s

Obfuscate folder structures and file names in the deployable archive (.ctf file) from the end user.

 
-S

Create singleton MATLAB Runtime.

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

-T

Specify the output target phase and type.

Cannot be used in a deploytool app.

-u

Registers COM component for current user only on development machine.

Valid only for generic COM components and Microsoft Excel add-ins.

-U

Generate a deployable archive (.ctf file) for MATLAB Production Server™.

Equivalent to -W 'CTF'. Cannot be used in a deploytool app.

-v

Verbose; display compilation steps.

 

-w option

Display warning messages.

option = list, level, or level:string

where

level = disable, enable, error, off:string, or on:string

-W type

Control the generation of function wrappers.

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

Cannot be used in a deploytool app.

-X

Ignore data files detected by dependency analysis.For more information, see Dependency Analysis Using MATLAB Compiler.
-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
-Z optionSpecify method of including support packages.

option = 'autodetect' (default), 'none', or packagename.

Packaging Log and Output Folders

By default, the deployment app places the packaging log and the Testing Files, End User Files, and Packaged Installers folders in the target folder location. If you specify a custom location, the app creates any folders that do not exist at compile time.