From: J J on
Hello Matlab Community,

I need help ASAP! Any thoughts/input on what might be going wrong would be appreciated. I'm new to creating Matlab GUIs. I have created a straight forward GUI that works fine in the Matlab enviroment and consists of simple static text, editable text and push buttons. When I compile to create a stand alone application using 'mcc -o outputfile -m guifilename.m', the warnings and errors below are generated (the GUI does pop-up when I click on the .exe file but does not function):

- Warning: Could not find appropriate function on path loading function handle C:\Program Files\MATLAB\R2008a\toolbox\matlab\guide\guidemfile.m@<hObject,eventdata>MFL_GUI<'input1_Callback',hObject,eventdata,guidata<hObject>>
> In hgload at 43
In openfig at 78
In gui_mainfcn>local_openfig at 271
In MFL_GUI at 16
(It loops over and over)
Then the following:
??? Error using ==> struct2handle
Undefined function handle

??? Error using ==> struct2handle
Error while evaluating uicontrol CreateFcn

Any help would be appreciated...

Thanks,
J
From: Walter Roberson on
J J wrote:

> I need help ASAP! Any thoughts/input on what might be going wrong would
> be appreciated. I'm new to creating Matlab GUIs. I have created a
> straight forward GUI that works fine in the Matlab enviroment and
> consists of simple static text, editable text and push buttons. When I
> compile to create a stand alone application using 'mcc -o outputfile -m
> guifilename.m', the warnings and errors below are generated (the GUI
> does pop-up when I click on the .exe file but does not function):
>
> - Warning: Could not find appropriate function on path loading function
> handle C:\Program
> Files\MATLAB\R2008a\toolbox\matlab\guide\guidemfile.m@<hObject,eventdata>MFL_GUI<'input1_Callback',hObject,eventdata,guidata<hObject>>

Did you export input1_Callback ?

http://www.mathworks.com/access/helpdesk/help/toolbox/compiler/function.html
From: J J on
Thanks for the response Walter. I'm not sure what tham means. Can you please elaborate a bit...

Thanks...

Walter Roberson <roberson(a)hushmail.com> wrote in message <i17q8v$m4e$1(a)canopus.cc.umanitoba.ca>...
> J J wrote:
>
> > I need help ASAP! Any thoughts/input on what might be going wrong would
> > be appreciated. I'm new to creating Matlab GUIs. I have created a
> > straight forward GUI that works fine in the Matlab enviroment and
> > consists of simple static text, editable text and push buttons. When I
> > compile to create a stand alone application using 'mcc -o outputfile -m
> > guifilename.m', the warnings and errors below are generated (the GUI
> > does pop-up when I click on the .exe file but does not function):
> >
> > - Warning: Could not find appropriate function on path loading function
> > handle C:\Program
> > Files\MATLAB\R2008a\toolbox\matlab\guide\guidemfile.m@<hObject,eventdata>MFL_GUI<'input1_Callback',hObject,eventdata,guidata<hObject>>
>
> Did you export input1_Callback ?
>
> http://www.mathworks.com/access/helpdesk/help/toolbox/compiler/function.html
From: J J on
To be more specific, here is the code you are refering to.
-------------

function input1_Callback(hObject, eventdata, handles)

input1=get(hObject,'String');

guidata(hObject, handles);

function input1_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

function input2_Callback(hObject, eventdata, handles)

input2=str2num(get(hObject,'String'));

guidata(hObject, handles);

function input2_CreateFcn(hObject, eventdata, handles)

if ispc && isequal(get(hObject,'BackgroundColor'), get(0,'defaultUicontrolBackgroundColor'))
set(hObject,'BackgroundColor','white');
end

....etc

"J J" <hussamj(a)gmail.com> wrote in message <i180jf$aek$1(a)fred.mathworks.com>...
> Thanks for the response Walter. I'm not sure what tham means. Can you please elaborate a bit...
>
> Thanks...
>
> Walter Roberson <roberson(a)hushmail.com> wrote in message <i17q8v$m4e$1(a)canopus.cc.umanitoba.ca>...
> > J J wrote:
> >
> > > I need help ASAP! Any thoughts/input on what might be going wrong would
> > > be appreciated. I'm new to creating Matlab GUIs. I have created a
> > > straight forward GUI that works fine in the Matlab enviroment and
> > > consists of simple static text, editable text and push buttons. When I
> > > compile to create a stand alone application using 'mcc -o outputfile -m
> > > guifilename.m', the warnings and errors below are generated (the GUI
> > > does pop-up when I click on the .exe file but does not function):
> > >
> > > - Warning: Could not find appropriate function on path loading function
> > > handle C:\Program
> > > Files\MATLAB\R2008a\toolbox\matlab\guide\guidemfile.m@<hObject,eventdata>MFL_GUI<'input1_Callback',hObject,eventdata,guidata<hObject>>
> >
> > Did you export input1_Callback ?
> >
> > http://www.mathworks.com/access/helpdesk/help/toolbox/compiler/function.html
From: Walter Roberson on
J J wrote:
> To be more specific, here is the code you are refering to.
> -------------
>
> function input1_Callback(hObject, eventdata, handles)
>
> input1=get(hObject,'String');
>
> guidata(hObject, handles);
>
> function input1_CreateFcn(hObject, eventdata, handles)
>
> if ispc && isequal(get(hObject,'BackgroundColor'),
> get(0,'defaultUicontrolBackgroundColor'))
> set(hObject,'BackgroundColor','white');
> end
>
> function input2_Callback(hObject, eventdata, handles)
>
> input2=str2num(get(hObject,'String'));
>
> guidata(hObject, handles);
>
> function input2_CreateFcn(hObject, eventdata, handles)
>
> if ispc && isequal(get(hObject,'BackgroundColor'),
> get(0,'defaultUicontrolBackgroundColor'))
> set(hObject,'BackgroundColor','white');
> end
> ...etc


Any routine that is only called through eval() or feval() or by way of a
callback in which the routine name is a quoted string, will not be found by
the dependency analysis routine, and therefore will not be included in the
executable. So in gui.m, add lines such as

%#function input1_Callback
%#function input2_Callback

naming all of the file names that are not automatically detectable.

http://www.mathworks.com/access/helpdesk/help/toolbox/compiler/function.html
 |  Next  |  Last
Pages: 1 2
Prev: WindowButtonMotionFcn Hang
Next: contour color question