This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.

Error and Warning Messages

About Error and Warning Messages

This appendix lists and describes error messages and warnings generated by the compiler. Compile-time messages are generated during the compile or link phase. It is useful to note that most of these compile-time error messages should not occur if the MATLAB® software can successfully execute the corresponding MATLAB file.

Use this reference to:

  • Confirm that an error has been reported

  • Determine possible causes for an error

  • Determine possible ways to correct an error

When using MATLAB Compiler SDK™, if you receive an internal error message, record the specific message and report it to Technical Support at

Compile-Time Errors

Error: An error occurred while shelling out to mex/mbuild (error code = errorno). Unable to build (specify the -v option for more information)

The compiler reports this error if mbuild or mex generates an error.

Error: An error occurred writing to file "filename": reason

The file can not be written. The reason is provided by the operating system. For example, you may not have sufficient disk space available to write the file.

Error: Cannot write file "filename" because MCC has already created a file with that name, or a file with that name was specified as a command line argument

The compiler has been instructed to generate two files with the same name. For example:

mcc -W lib:liba liba -t 	% Incorrect

Error: Could not check out a Compiler license

No additional MATLAB Compiler SDK licenses are available for your workgroup.

Error: File: "filename" not found

A specified file can not be found on the path. Verify that the file exists and that the path includes the file's location. You can use the -I option to add a folder to the search path.

Error: File: "filename" is a script MATLAB file and cannot be compiled with the current Compiler

The compiler cannot compile script MATLAB files.

Error: File: filename Line: # Column: # A variable cannot be made storageclass1 after being used as a storageclass2

You cannot change a variable's storage class (global/local/persistent). Even though MATLAB allows this type of change in scope, the compiler does not.

Error: Found illegal whitespace character in command line option: "string". The strings on the left and right side of the space should be separate arguments to MCC

For example:

mcc('-m', '-v', 'hello')% Correct
mcc('-m -v', 'hello')	  % Incorrect

Error: Improper usage of option -optionname. Type "mcc -?" for usage information

You have incorrectly used a MATLAB Compiler SDK option. For more information about MATLAB Compiler SDK options, see mcc Command Arguments Listed Alphabetically (MATLAB Compiler), or type mcc -? at the command prompt.

Error: libraryname library not found

MATLAB has been installed incorrectly.

Error: mclFreeStackTrace

The compiler reports this error when startup.m file executes functions that alter MATLAB search path, for example, cd or addpath. Hence, startup.m file cannot execute appropriately in deployed environment.

Insert the isdeployed function before the path altering functions in the startup.m file and recompile the application after modifying startup.m.

Error: No source files were specified (-? for help)

You must provide the compiler with the name of the source file(s) to compile.

Error: "optionname" is not a valid -option argument

You must use an argument that corresponds to the option. For example:

mcc -W main ...	% Correct
mcc -W mex  ...	% Incorrect

Error: Out of memory

Typically, this message occurs because the compiler requests a larger segment of memory from the operating system than is currently available. Adding additional memory to your system can alleviate this problem.

Error: Previous warning treated as error

When you use the -w error option, this error appears immediately after a warning message.

Error: The argument after the -option option must contain a colon

The format for this argument requires a colon. For more information, see mcc, or type mcc -? at the command prompt.

Error: The environment variable MATLAB must be set to the MATLAB root directory

On UNIX®, the MATLAB and LM_LICENSE_FILE variables must be set. The mcc shell script does this automatically when it is called the first time.

Error: The license manager failed to initialize (error code is errornumber)

You do not have a valid license or no additional licenses are available.

Error: The option -option is invalid in modename mode (specify -? for help)

The specified option is not available.

Error: The specified file "filename" cannot be read

There is a problem with your specified file. For example, the file is not readable because there is no read permission.

Error: The -optionname option requires an argument (e.g. "proper_example_usage")

You have incorrectly used a compiler option. For more information about compiler options, see mcc, or type mcc -? at the command prompt.

Error: -x is no longer supported

The compiler no longer generates MEX-files because there is no longer any performance advantage to doing so. The MATLAB JIT Accelerator makes compilation for speed obsolete.

Error: Unable to open file "filename":<string>

There is a problem with your specified file. For example, there is no write permission to the output folder, or the disk is full.

Error: Unable to set license linger interval (error code is errornumber)

A license manager failure has occurred. Contact Technical Support with the full text of the error message.

Error: Unknown warning enable/disable string: warningstring

-w enable:, -w disable:, and -w error: require you to use one of the warning string identifiers listed in Warning Messages.

Error: Unrecognized option: -option

The option is not a valid option. See mcc, for a complete list of valid options for MATLAB Compiler SDK, or type mcc -? at the command prompt.

Warning Messages

This section lists the warning messages that MATLAB Compiler SDK can generate. Using the -w option for mcc, you can control which messages are displayed. Each warning message contains a description and the warning message identifier string (in parentheses) that you can enable or disable with the -w option. For example, to produce an error message if you are using a trial MATLAB Compiler SDK license to create your standalone application, you can use:

mcc -w error:trial_license -mvg hello

To enable all warnings except those generated by the save command, use:

mcc -w enable -w disable:trial_license ...

To display a list of all the warning message identifier strings, use:

mcc -w list

For additional information about the -w option, see mcc.

Warning: File: filename Line: # Column: # The #function pragma expects a list of function names

Identifier: pragma_function_missing_names

This pragma informs the compiler that the specified function(s) provided in the list of function names will be called through an feval call. This will automatically compile the selected functions.

Warning: MATLAB file "filename" was specified on the command line with full path of "pathname", but was found on the search path in directory "directoryname" first

Identifier: specified_file_mismatch

The compiler detected an inconsistency between the location of the MATLAB file as given on the command line and in the search path. The compiler uses the location in the search path. This warning occurs when you specify a full path name on the mcc command line and a file with the same base name (filename) is found earlier on the search path. This warning is issued in the following example if the file afile.m exists in both dir1 and dir2,

mcc -m -I /dir1 /dir2/afile.m

Warning: The file filename was repeated on MATLAB Compiler SDK command line

Identifier: repeated_file

This warning occurs when the same file name appears more than once on the compiler command line. For example,

mcc -m sample.m sample.m

Warning: The name of a shared library should begin with the letters "lib". "libraryname" doesn't

Identifier: missing_lib_sentinel

This warning is generated if the name of the specified library does not begin with the letters “lib”. For example,

mcc -t -W lib:liba -T link:lib a0 a1

will not generate a warning while

mcc -t -W lib:a -T link:lib a0 a1

will generate a warning.

This warning is specific to UNIX and does not occur on the Windows® operating system.

Warning: All warnings are disabled

Identifier: all_warnings

This warning displays all warnings generated by the compiler. This warning is disabled.

Warning: A line has num1 characters, violating the maximum page width (num2)

Identifier: max_page_width_violation

This warning is generated if there are lines that exceed the maximum page width, num2. This warning is disabled.

Warning: The option -optionname is ignored in modename mode (specify -? for help)

Identifier: switch_ignored

This warning is generated if an option is specified on the mcc command line that is not meaningful in the specified mode. This warning is enabled.

Warning: Unrecognized Compiler pragma “pragmaname

Identifier: unrecognized_pragma

This warning is generated if you use an unrecognized pragma. This warning is enabled.

Warning: "functionname1" is a MEX- or P-file being referenced from "functionname2"

Identifier: mex_or_p_file

This warning is generated if functionname2 calls functionname1, which is a MEX- or P-file. This warning is enabled.

Trial Compiler license. The generated application will expire 30 days from today, on date

Identifier: trial_license

This warning displays the date that the deployed application will expire. This warning is enabled.

Dependency Analysis Errors

MATLAB Runtime/Dispatcher Errors

These errors originate directly from the MATLAB Runtime/Dispatcher. If one of these error occurs, report it to Technical Support at MathWorks at

XML Parser Errors

These errors appear as

depfun Error: XML error: <message>

Where <message> is a message returned by the XML parser. If this error occurs, report it to Technical Support at MathWorks at

Was this topic helpful?