Why do I receive a compilation error about undefined function or variable "handle" or "graph2d" with MATLAB Compiler?

When compiling my application with:
mcc -v -m myapp.m
I receive the following errors:
References to "handle" will produce a run-time error because it is an undefined function or variable.
References to "graph2d" will produce a run-time error because it is an undefined function or variable.

 Accepted Answer

These errors occur because your application is using graphics, but you have not told MCC that you want to compile a graphics application.
The compile command you should use is:
mcc -v -B sgl myapp.m
This will eliminate these errors.

More Answers (0)

Categories

Products

Release

R13SP1

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!