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

2 views (last 30 days)
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 Comment
Harakhun Tanatavikorn
Harakhun Tanatavikorn on 21 Feb 2012
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.

Sign in to comment.

Accepted Answer

Kaustubha Govind
Kaustubha Govind on 21 Feb 2012
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 Comments
Harakhun Tanatavikorn
Harakhun Tanatavikorn on 21 Feb 2012
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 on 22 Feb 2012
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.

Sign in to comment.

More Answers (0)

Categories

Find more on C Shared Library Integration in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!