Compiled Stand Alone Application won't function properly without installing LCC compiler.

Greetings,
System Information: Matlab 2010a
Problem: Compiled Stand Alone application requires extra installation of lcc compiler to execute main GUI callback.
I have a simulink model that I've successfully build into a Real-Time Workshop Embedded Library (ert_shrlib.tlc). After that I've implemented/integrated the library into a GUI that I then compiled with the Matlab Compiler. There were no error messages and everything seemed smooth.
Both mex -setup and mbuild -setup compiler settings were "Microsoft Visual C++ 2008 Express".
The test PC (without matlab) for the standalone applications has the corresponding MCR (matching the matlab version) and vcredist_x86 (for the Microsoft Visual C++ Express) installed.
I am able to run the file (the GUI starts) but the model step function of my compiled Simulink model doesn't work and I am unable to identify where the error is.
This can be fixed by additionally installing the lcc on the PC in the matlab runtime components folder (sys).
Currently I suspect that this segment of my code causes this problem:
pointstr=['Sim_Time','_pointer','=libpointer(',native2unicode(39),'doublePtr',native2unicode(39),', zeros(1,1));']; eval(pointstr);
My suspect is that when I use the eval(pointstr) the stand alone application doesn’t posses the necessary lcc library (default matlab) . My question, isn't there anyway to get rid of the need/requirement to install the LCC compiler on the User PC? I thought choosing a different compiler during the compilation of the Simulink model and Matlab Compiler would eliminate the requirement of LCC compiler on the target PC.
Any help or insight would be much appreciated!!!
Best Regards, Harakhun T.

1 件のコメント

Harakhun Tanatavikorn
Harakhun Tanatavikorn 2012 年 2 月 21 日
Additional Information
I'm also able to provide compilation log (both of RTW and Matlab Compiler) and my m-file code and GUI figure.
I compiled the GUI (with Matlab Compiler) via the deploytool, "Build" button.

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

 採用された回答

Kaustubha Govind
Kaustubha Govind 2012 年 2 月 21 日

0 投票

Are you sure the issue is due to the call to LIBPOINTER and not LOADLIBRARY? (You could insert some "disp" statements after each line to see which one is failing). It is loadlibrary that needs a compiler to parse the header file argument. To avoid the need for a compiler with loadlibrary, you could generate a prototype file on your MATLAB installation, and use that as the loadlibrary argument (instead of the header file argument). Also, remember to add your prototype file to the MATLAB Compiler generated package.

3 件のコメント

Harakhun Tanatavikorn
Harakhun Tanatavikorn 2012 年 2 月 21 日
Thx for the swift answer, if I insert the "disp" statments into my code, after I compile it and test it on my test PC will a DOS command window pop up? That would be really helpful in diagnosing where the error stems from.
I'll go ahead and checkout using the prototype file so that the loadlibrary doesn't have to parse the header file (maybe that is what causes the lcc dependency).
Harakhun Tanatavikorn
Harakhun Tanatavikorn 2012 年 2 月 21 日
You were correct, the problem was indeed the loadlibrary function parsing the header file. I've switch to prototype file and now everything works fine :) thx!!
Kaustubha Govind
Kaustubha Govind 2012 年 2 月 22 日
Glad. That worked. Btw, if you compile your code as a "Console Application" and start your executable from a command window, you should see the results of disp statements. Alternatively, you can use the mcc -R -logfile option to specify a file that the output is logged to.

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB Compiler についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by