While compiling my program in MATLAB 2012a to create windows standalone application.I am getting errors.
1 view (last 30 days)
Show older comments
While compiling my program in MATLAB 2012a to create windows standalone application.I am getting following errors:
Warning: an error occurred while parsing class emlcoder.InferenceReport:
Undefined function 'findclass' for input arguments of type 'double'.
My code is
filename = 'testvid.avi';
hvfr = vision.VideoFileReader(filename,...
'ImageColorSpace', 'Intensity',...
'VideoOutputDataType','single');
%create a median filter system object
hmedianfilt = vision.MedianFilter;
%create contrast adjsuter system object
hcontadj = vision.ContrastAdjuster;
% create edge detection system object
hedge = vision.EdgeDetector( ...
'Method', 'Prewitt', ...
'ThresholdSource', 'Property', ...
'Threshold', 10/256, ...
'EdgeThinning', true);
%Create an AlphaBlender System object to overlay the edges on the original video frame.
hAB = vision.AlphaBlender('Operation', 'Highlight selected pixels');
%Create System objects to display the results.
playerEdge= vision.DeployableVideoPlayer('Name', 'Edge');
while ~isDone(hvfr)
img = step(hvfr); % Read input video frame
% apply median filter
image = step(hmedianfilt, img);
%contrast adjsutment
image=step(hcontadj, image);
%apply edge detection
edges = step(hedge,image);
%apply AlphaBlender
composite = step(hAB, image, edges);
%play video
step(playerEdge,composite);
end
% Close the video object
release(hvfr);
0 Comments
Accepted Answer
Kaustubha Govind
on 18 Apr 2012
Seems similar to this previous question: http://www.mathworks.com/matlabcentral/answers/27493-building-standalone-application-fails-on-file-i-don-t-use
Try:
>> mcc -m mytest.m -N -p 'C:\Program Files\MATLAB\R2011b\toolbox\vision'
3 Comments
Kaustubha Govind
on 18 Apr 2012
Use the -a option to add additional files to the CTF archive. See: http://www.mathworks.com/help/toolbox/compiler/mcc.html
More Answers (1)
Matthijs
on 26 Oct 2012
I experienced the same issue with R2012a, after having successfully compiled the same code on R2010b. Since it's just a warning I ran the compiled executable anyway, but it failed with an "ApplicationRedefinedException". Here's how I fixed the problem (not claiming that this solution works for everyone).
My code makes use of MEX-files generated with EMLMEX, so I figured it had something to do with that. I went through these steps (I'll list them all, even though some did not help to fix the issue). For the impatient, steps 5 and 6 fixed the issue.
1. Converted the scripts used to generate the MEX-files using CODER.UPGRADE
2. Using the converted scripts (that use CODEGEN instead of EMLMEX) re-compiled the MEX files. This did not solve the issue.
3. Changed my main routine to call the regular M-files instead of the MEX-files. This didn't fix the issue.
4. Searched the path for occurrences of "emlcoder". Deleted all files containing occurrences (such as backups generated by coder.upgrade), until there were no more occurrences. This didn't fix the issue.
5. One of the paths containing a MEX-file was included in the mcc command with the -a option. I changed this to the -I option (so that only files that can be determined to be needed at compile time are included). This fixed the issue.
6. However, I need this -a option for this path. I moved the scripts in this path used to generate the MEX-files (the upgraded scripts that don't make use of eml, but of coder) to another directory that is not included in mcc. This fixed the issue.
Hope this helps.
0 Comments
See Also
Categories
Find more on MATLAB Compiler in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!