MATLAB: Compiled Stand Alone Application won’t function properly without installing LCC compiler.

dependencylccMATLABMATLAB Compilermatlab guireal time workshopsimulink coder

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.

Best Answer

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.