deploying standalone .exe for xpc control gui problem !! please help !!

hey guys ! this is my graduation project and its really important for me to get this working asap ! I have learned alot from the community over here (matlab self taught) and was hoping some one could help out one more time !
lets jump to the problem ... I know a thing or two about matlab, developing models, m-files, blah blah blah , when it comes to C and compilers and stuff, not so much. I have a machine thingy thats got 2 motors and 2 encoders, I am running it using xpc and a dedicated target computer. communication over TCP, downloaded the infinity famous xpc_gui_demo and I am controlling the target from the host using this gui. now all the fine tuning has been done and I am happy with it.
now I am trying to make a standalone .exe of the control gui using the deploytool, but this is where I come short. Here is the log file I get during a compilation attempt. guys please advice, ANYTHING even if ur not 100% sure, I am going nuts here and will try anything that sounds remotely correct to get this thing working ! Thanks alot !
Log file:
ant:
<mkdir dir="C:\Users\Ahmed Atlam\Desktop\Target_Working_Folder\deploy_T1\deploy_T1\distrib" />
<mkdir dir="C:\Users\Ahmed Atlam\Desktop\Target_Working_Folder\deploy_T1\deploy_T1\src" />
mcc -o deploy_T1 -W WinMain:deploy_T1 -T link:exe -d 'C:\Users\Ahmed Atlam\Desktop\Target_Working_Folder\deploy_T1\deploy_T1\src' -w enable:specified_file_mismatch -w enable:repeated_file -w enable:switch_ignored -w enable:missing_lib_sentinel -w enable:demo_license -v 'C:\Users\Ahmed Atlam\Desktop\Target_Working_Folder\xPC_GUIdemo.m' -a 'C:\Program Files\MATLAB\R2012a'
Compiler version: 4.17 (R2012a)
Depfun error: 'Error: File: C:\Program Files\MATLAB\R2012a\help\techdoc\matlab_oop\examples\@AccountManager\AccountManager.m Line: 3 Column: 13
Attempt to execute SCRIPT true as a function:
C:\Program Files\MATLAB\R2012a\toolbox\compiler\mcr\matlab\elmat\true.m'
have no clue on how to deal with the above Depfun (deploy function) error !! I have tried a million times compiling and there was always a file missing (something along superclass cannot be found) so I just added the whole matlab root folder and the compiler chooses what ever it needs from it ? is this right? is that the problem ??

5 Comments

Weird, it is trying to execute the help file for "true" !
I have seen some strange error messages happen when the main program to be compiled is a script instead of a function. Could you check that?
First thanks alot for answering, I really appreciate any help !!
spot on ! I have noticed that too, so I tried to add all the root WITHOUT the help folders and it returned with a crash report. Also, tried to examine this true.m script, it doesnt open in editor and any other functions/scripts/ anything that is in the same working folder doesnt work until you move them to another folder
as for the main program, in a sense it is a script. its just a control gui for xpc application, so there isnt alot of varriable passing (just connect, load application, run, timer function, stop, getscope and plot, with some setparam for the model ... thats it) ... I am no matlab pro so I dont know if this qualifies as a script ( the gui is made in GUIDE with the .fig and everything is in handles) ... I have complied guis like that before, but non had to deal with xpc target, they were all just simulations, PID calculators, small editor apps ... ect
please let me know what do u think of this and thanks alot
Ahmed Atlam
and yeah I forgot to ask as well, why is Accountmanager.m for EXAMPLES trying to execute a true.m for HELP ... technically speaking, matlab should run fine WITHOUT help, or examples ... why do they even show up here ??
"script" is a technical term for MATLAB, and refers to a .m file in which the first executable line does not start with "function" (a function file) or "classdef" (a class definition file.)
It should not be attempting to execute true.m . true() is a built-in function that does not need .m code, except for the fact that the "help" function looks in the .m file for the help information. The fact that it is attempting to execute true.m indicates that something very strange is going on. Either somehow the current directory got set to the directory with the true.m file, or else MATLAB lost track of the internal code library that has the actual code for "true" in it. The only times I have seen something similar have been when there has been corruption of the installation, or when the Compiler has gotten fouled up because the main .m file was a script (in the sense described above.)
thank you very much for clearing up the script definition issue for me, in that case, the gui starts with
function varargout = xPC_GUIdemo(varargin)
which I think negates the option that it is a script, althgough there are no varargout or in passed to any workspace. (not that I am aware of anyway ... not quit familiar with that level of detail for matlab) which leave the option of re installing matlab, or rolling back to R2009b if necessary. would you recommend that ? Do u think its worth it? I have lots of add-ons and psychHID which will make it a bit painful restoring everything to my current working state. Also, I have MSVB C# and C++ 2010 Express installed (aurduino and netduino stuff) do u think that their external C compiler might be causing a conflict with the matlab compiler (is that even vaild ? ) Thank you very much for all ur advice sir, I am really grateful for it. Ahmed Atlam

Sign in to comment.

Answers (1)

Have you run the Dependency Report on your code before you compiled it? Another more comprehensive tool is fdep ( http://www.mathworks.com/matlabcentral/fileexchange/17291s
Then, after you get it to compile and it won't run on your target computer, check the FAQ: http://matlab.wikia.com/wiki/FAQ#My_standalone_executable_won.27t_run_on_the_target_computer._What_can_I_try.3F

2 Comments

Oh thank you very much for advice ... will give it a shot and let you know how it works
I never have a compilation line this complicated:
mcc -o deploy_T1 -W WinMain:deploy_T1 -T link:exe -d 'C:\Users\Ahmed Atlam\Desktop\Target_Working_Folder\deploy_T1\deploy_T1\src' -w enable:specified_file_mismatch -w enable:repeated_file -w enable:switch_ignored -w enable:missing_lib_sentinel -w enable:demo_license -v 'C:\Users\Ahmed Atlam\Desktop\Target_Working_Folder\xPC_GUIdemo.m' -a 'C:\Program Files\MATLAB\R2012a'
Occasionally I'll have the -d switch to send the executable to a different folder, or the -a option to include things like DLLs. What happens if you simply try
mcc -m deploy_T1.m -d 'C:\Users\Ahmed Atlam\Desktop\Target_Working_Folder\deploy_T1\deploy_T1\src'

Sign in to comment.

Asked:

on 8 Jul 2012

Community Treasure Hunt

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

Start Hunting!