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

-C

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

None

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

Protect Source Code

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

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

Debugging

OptionDescriptionComment
-?

Display help message.

None

-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

MATLAB Compiler for Excel Add-Ins

OptionDescriptionComment
-b

Generate Excel compatible formula function.

Requires MATLAB Compiler. 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 (requiring MATLAB Compiler)

MATLAB Path

OptionDescriptionComment
-I directory

Add folder to search path for MATLAB files.

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

Cannot be used in a deploytool app.

Override Default Outputs

OptionDescriptionComment
-d directory

Place output in specified folder.

None

-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 display the Windows Command Shell (console) for execution in the Additional Runtime Settings area.

-o outputfile

Specify name of final output file.

Adds appropriate extension

Wrappers and Libraries

OptionDescriptionComment
-c

Suppress compiling and linking of the generated C wrapper code.

Must be used in conjunction with the -l option.

-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

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