Main Content

mcc Command Line Arguments Grouped by Task

COM Components

Option Description Comment
-u

Registers COM component for current user only on development machine

Valid only for generic COM components andMicrosoft®Excel®add-ins (requiringMATLAB®Compiler™)

Deployable Archive

Option Description Comment

-afilename

Addfilenameto the deployable archive.

None

-C

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

None

Debugging

Option Description Comment
-g

Generate debugging information.

None

-G

Same as-g

None

-K

Directsmccto 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

-Wtype

Control the generation of function wrappers.

type=maincpplib:lib:nonecom:compname,clname,version

-?

Display help message.

None

Dependency Function Processing

Option Description Comment

-afilename

Addfilenameto the deployable archive.

None

Licenses

Option Description Comment
-Y licensefile

Uselicensefilewhen checking out aMATLAB Compilerlicense.

The-Y国旗的工作s only with the command-line mode.

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

MATLABCompilerforExcelAdd-Ins

Option Description Comment
-b

Generate Excel compatible formula function.

RequiresMATLAB Compiler

-u

Registers COM component for current user only on development machine

Valid only for generic COM components andMicrosoft Exceladd-ins (requiringMATLAB Compiler)

MATLABPath

Option Description Comment
-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

Adddirectoryto compilation path in an order-sensitive context.

Requires-Noption

mbuild

Option Description Comment
-f filename

Use the specified options file,filename, when callingmbuild.

mbuild -setupis recommended.

-M string

Pass string tombuild.

Use to define compile-time options.

MATLAB运行时

Option Description Comment

-Roption

Specify run-time options forMATLAB Runtime.

option= -nojvm -nodisplay '-logfile,filename' -startmsg -completemsgfilename

-S

Create SingletonMATLAB Runtime.

Default for generic COM components. Valid forMicrosoft Exceland Java®packages.

Override Default Inputs

Option Description Comment
-B filename[:arg[,arg]]

Replace-B filenameon themcccommand line with the contents offilename(bundle).

The file should contain onlymcccommand-line options. These are MathWorks included options files:

  • -B csharedlib:foo— C shared library

  • -B cpplib:foo— C++ library

Override Default Outputs

Option Description Comment
-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-ein place of the-moption. Available for Windows®only. Use with-Roption 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, unselectDo not display the Windows Command Shell (console) for executionin theAdditional Runtime Settingsarea.

Wrappers and Libraries

Option Description Comment
-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

-Wtype

Control the generation of function wrappers.

type=maincpplib:lib:nonecom:compname,clname,version