Why do I receive an error when compiling a MATLAB graphics application?
9 ビュー (過去 30 日間)
古いコメントを表示
MathWorks Support Team
2010 年 1 月 21 日
編集済み: MathWorks Support Team
2023 年 4 月 19 日
I am having a problem compiling a stand-alone program that I wrote in MATLAB. The Engine of this file is a MATLAB function that calls a bunch of other files. I used the following MATLAB compiling command to create a stand-alone executable:
mcc -t -B sgl filenames.m
I believe I have the C Math Library, C Graphics Library, and other MATLAB libraries installed. However, I keep receiving the following error message:
ERROR: undefined reference to '_mclMainhg'
採用された回答
MathWorks Support Team
2023 年 4 月 18 日
編集済み: MathWorks Support Team
2023 年 4 月 19 日
This error occurs when the MATLAB C/C++ Graphics library is not properly installed.
You can verify if this is indeed the case by looking into the
$MATLAB/extern/examples folder
(where $MATLAB = the MATLAB root directory on your machine)
to see if a folder called "sgl" exists. If it does not exist, you do not have the MATLAB C/C++ Graphics Library and therefore will not be able to compile any MATLAB application that uses graphics.
You may purchase and install the MATLAB C/C++ Graphics Library product if you are using MATLAB 6.1 (R12.1) and earlier.
In MATLAB 6.5 (R13), the MATLAB Compiler tool is sold as an integrated product that includes the MATLAB C/C++ Graphics Library and the MATLAB C/C++ Math Library. Therefore, if you do not see the "sgl" folder in MATLAB 6.5 (R13), you will need to purchase and install the complete MATLAB Compiler product.
If you need more information about our product lines and specific information about any of our products you can visit
.
You may also send an email to our Pricing and Purchasing team at pricing@mathworks.com for more information about purchasing this product.
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で C Shared Library Integration についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!