I created a Gui and when I am running from the .exe file it crashes and just make a sound which is showing that the program stopped. When I am running it through matlab it works perfect and there is no error. How can I add something to the program to show what is the error and why the program crashes? I need to display the error while i am using the .exe file.

9 commentaires

Geoff Hayes
Geoff Hayes le 6 Juil 2018
Sara - is the crash reproducible? what are you doing when the app crashes?
faran
faran le 6 Juil 2018
I don't know what is the error, but only it is happening on .exe file. I guess it is related to the computer vision toolbox and probably OCR algorithm.
OCDER
OCDER le 6 Juil 2018
Perhaps OCRBuildable.m was not packaged in the compiled application, thus causing it to crash?
Geoff Hayes
Geoff Hayes le 6 Juil 2018
Sara - but what are you doing - in the app/GUI - when it crashes? Does it always crash when you repeat those steps?
faran
faran le 6 Juil 2018
Yes my question is related to the other link but that error is showing during the compiling! I generated an .m file of the OCRBuildable and included it in the package, but still I can not run the program. The GUI will start to show an image and then apply the OCR on it to extract the text. next it will use neural network to say if the image is in the group A or group B. I tried other part of the Gui and they are working, only on the OCR section I guess it is crashing!
OCDER
OCDER le 6 Juil 2018
" I tried other part of the Gui and they are working, only on the OCR section I guess it is crashing!"
So just to clarify, your EXE file DOES run, but then it just crashes and exits when you try OCR? And you were able to compile WITHOUT any error, as in OCRBuildable.m issue you had is resolved?
It'll be hard to figure out the issue unless we see the full GUI and .m files for it.
faran
faran le 6 Juil 2018
.EXE file does run but it crash when it reaches to do the OCR. The compile will be finished but with error given below:
[Warning: Excluded "C:/Program Files/MATLAB/R2018a/toolbox/vision/vision/+vision/+internal/+buildable/OCRBuildable.m"; reason: The file or function has been excluded from packaging for the "MCR" target environment according to the "Compiler" license. Either remove the file or function from your code, or use the MATLAB function "isdeployed" to ensure the function is not invoked in the deployed component.]
Since it was exluding the OCRBuildable.m file ( I am not sure why!!) I created .m file and before starting the Package I added to the sections callse "Files required for your application to run". But still I receive the same error.
I want to know it is not allowed to compile a GUI which is using two toolbox of computer vision and neural network? Is that because I am receiving this error?
OCDER
OCDER le 6 Juil 2018
Do you have the license for the computer visions toolbox? The compiler will check to make sure you have the toolbox license activated before it compile the application. Also, certain Computer Vision Toolbox components cannot be compiled - see if you have any of these in your code:
If you do, you'll have to disable it using statements like:
if ~isdeployed
.... your OCR code
else
warning('this function is not available for deployed version').
return
end
There's isn't a OCRBuildable.m document, so not sure which functions are using that. You'll have to hunt that function down... or try adding some msgbox throughout your OCR code to see which msgbox appears before crashing. It'll narrow your search.
a = 1;
msgbox('line 1 passed')
b = 2;
msgbox('line 3 passed')
c = myOCR(a, b)
msgbox('line 5 passed'); %In exe, this didn't show up, so you know error occurred before this.
faran
faran le 9 Juil 2018
So, I looked for the error and asked for help from mathwork and find out what was the problem. The problem was that I created a ocr.m file for my program and the compiling was not going well because of it. And I used the method you told me to find the error location and so far it is going well. Thank you so much

Connectez-vous pour commenter.

 Réponse acceptée

OCDER
OCDER le 6 Juil 2018

0 votes

1 commentaire

faran
faran le 6 Juil 2018
I read it and I tried to open it through the method given but still it is only making sound and not showing any error.

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur MATLAB Coder dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by