Main Content

mcc Command Arguments Listed Alphabetically

OptionDescriptionComment
-?

Display mcc help message.

 

-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

Add platforms to the list of supported platforms detected automatically by the compiler.

arch = win64, maci64, maca64, glnxa64, or all

-b

Generate Excel® compatible formula function.

Requires MATLAB® Compiler™ for Excel add-ins.

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

 
-e

Suppress appearance of the MS-DOS Command Window when launching the generated standalone application.

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

The Standalone Application Compiler app suppresses the MS-DOS command window by default. To enable it, select Standalone Windows Application in the Application Type 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 (since R2022b).

 
-J filename

Specify a secret manifest JSON file to embed the specified secret keys in the deployable archive (since R2024a).

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

Specify AES encryption key keyfile and MEX file loader interface mexfile to retrieve decryption key at runtime (since R2022b).

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

For C++ shared libraries, you can specify only the encryption key and provide the decryption key in your C++ application at runtime (since R2023b).

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

-m

Generate a standalone application.

Equivalent to -W main -T link:exe.

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 compile-time search 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.

-p folder

Add folder to compile-time search path in an order-sensitive context.

Requires -N option.

-r icon

Embed resource icon in binary.

Use to specify an application icon.

-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. (since R2021b).

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

-v

Verbose; display compilation steps and warning messages.

 

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

-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 all output files in the target folder location. If you specify a custom location, the app creates any folders that do not exist at compile time.