フィルターのクリア

Does Matlab C/C++ Graphics Library for compiler 2.0/3.0, support mix language (.c, .m) ?

2 ビュー (過去 30 日間)
Siamak Mohebbi
Siamak Mohebbi 2019 年 8 月 28 日
コメント済み: Siamak Mohebbi 2020 年 4 月 8 日
Runtime error when tried to generate a stand alone executable, when combining Matlab module with graphics and .c routine.
Amazingly the the following compile command did generate an executable but it did not include the graphics library call as part of the run time.
I used the following command to get the executable:
mcc -B sgl -t -W lib:Pkgout <Main.m> <module1.m> <module2.c>
And I get the fololowing error when I ran Main.exe
error. function call "figure" requires graphics library , use "-B sgl" switch when compiling
-----------------------------------------------------------------------------------------------
I tried various combination of the mcc command but no luck.
Matalb R11, R13
  4 件のコメント
Walter Roberson
Walter Roberson 2020 年 4 月 8 日
The trick I was referring to was not using -B sgl in itself, as the usr already had that at the beginning of the command. Instead, the trick I was referring to was to put the -B sgl towards the end of the line. The order of specifying libraries can be important as often there is no look-ahead: if library A calls upon library B then the order on the command line can need to be A then B, with B then A failing (depending on the details of how the linker works.)
Siamak Mohebbi
Siamak Mohebbi 2020 年 4 月 8 日
Hi
mcc -t -W lib:Pkgout <Main.m> <module1.m> <module2.c> -B sgl
Yes, various combination of complier command were tried including what was suggested. The above syntax is flat out not accepted by the compiler (mcc).
FYI: Since posying the question an alternate approcah was implemented by partitioning the application and calling them separately. Effectively by passing this difficiency.

サインインしてコメントする。

回答 (0 件)

カテゴリ

Help Center および File ExchangeC Shared Library Integration についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by