Main Content

mcc Command Arguments Listed Alphabetically

OptionDescriptionComment
-?

Display mcc help message.

Cannot be used in a deploytool app.

-a filepath

Add filepath 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 bundle[:parameters]

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

The file should contain only mcc command-line options. MathWorks® included bundle files are located in matlabroot\toolbox\compiler\bundles.

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

Place output in folder specified by outputfolder.

The specified folder must already exist. Cannot be used in a deploytool app.
-e

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

Use -e in place of the -m option. Available for Windows® only. 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

Include debugging symbol information for generated C/C++ code.

 

-h helpfile

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 folder

Add folder to search path for MATLAB files.

 
-j

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

 
-J filename

Specify a secret manifest JSON file to embed the specified secret keys in the deployable archive.

 
-k 'file=<keyfile>;loader=<mexfile>'

Specify AES encryption key keyfile and MEX-file loader interface mexfile 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

Direct 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 C shared 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.

On Windows, the command prompt opens on execution of the application.

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.

-M options

Pass compile-time options to mbuild.

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

Specify name of standalone application executable file.

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

-p folder

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

Requires -N option.

-r icon

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 phase:type

Specify the output target phase and type.

Cannot be used in a deploytool app.

-u

Register 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[:warning]

Control warning messages.

Valid arguments are list, enable[:warning], disable[:warning], error[:warning], on[:warning], and off[:warning].

-W 'target[:options]'

Specify build target and associated options.

target = main, WinMain, excel, hadoop, spark, lib, cpplib, com, or dotnet, java, python, CTF, or mpsxl.

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 licensefileOverride the default license file with the specified file licensefile.

Can only be used on the system command line.

-Z supportpackageSpecify method of including support packages.

supportpackage = '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.