How do I compile my simple GUI or graphical application using the MATLAB Compiler?
57 views (last 30 days)
Show older comments
When I compile my application with the following command:
mcc -m myGuiApp
I receive a lot of errors and warnings similar to these:
Warning: File: legend Line: 694 Column: 13
References to "handle" will produce a run-time error because it is an undefined function or variable.
Warning: File: legend Line: 656 Column: 8
References to "graph2d" will produce a run-time error because it is an undefined function or variable.
Warning: File: legend Line: 1705 Column: 17
The MATLAB Compiler does not currently support MATLAB object-oriented programming.
References to the method "domethod" will produce a run-time error.
Warning: File: c:\matlab6p5\toolbox\matlab\graph2d\legend.m Line: 1841 Column: 14
References to "get" require the C/C++ Graphics Library when executing in stand-alone mode.
You must specify -B sgl or -B sglcpp in order to use the C/C++ Graphics Library.
Also, if using the -W option, you must specify either the mainhg or libhg wrapper type.
A run-time error will occur if the C/C++ Graphics Library is not present when "get" is called.
I looked around in the documentation but not could determine why I receive these errors.
Accepted Answer
MathWorks Support Team
on 28 Jan 2010
This issue has been fixed in the MATLAB Compiler 4.0 (R14). If you are using a previous version, please read the following:
The correct way to compile an MATLAB file that uses graphics is to specify that you want to include the graphics libraries when compiling. This is done using the '-B sgl' flag with the MCC command (or '-B sglcpp' for C++):
mcc -B sgl myGuiApp
Although the warning messages above mention object-oriented programming, the correct problem is the missing graphics libraries in this case.
0 Comments
More Answers (0)
See Also
Categories
Find more on C Shared Library Integration in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!