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

2 vues (au cours des 30 derniers jours)
Ahmed Atlam
Ahmed Atlam le 8 Juil 2012
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 commentaires
Walter Roberson
Walter Roberson le 9 Juil 2012
"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.)
Ahmed Atlam
Ahmed Atlam le 9 Juil 2012
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

Connectez-vous pour commenter.

Réponses (1)

Image Analyst
Image Analyst le 8 Juil 2012
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 commentaires
Ahmed Atlam
Ahmed Atlam le 9 Juil 2012
Oh thank you very much for advice ... will give it a shot and let you know how it works
Image Analyst
Image Analyst le 9 Juil 2012
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'

Connectez-vous pour commenter.

Community Treasure Hunt

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

Start Hunting!

Translated by