0

When I am trying to make executable files of my .m-files on a Linux machine, some of the the .m-files are working absolutely fine.

However, one file which has camera input inside the .m-file is giving me this error:

Depfun error: 'Unexpected Standard exception from MEX file. What() is: ..' Error using mcc Error executing mcc, return status = 1 (0x1).

But when I use the same .m-file on Windows and R2012a it is working properly without any error.

I found a bug report here - is this a similar problem?

How do I solve it?

Here is the simple code of my .m-file:

function yuv()
 vid1 = videoinput('linuxvideo', 1, 'YUYV_1280x960');
 set(vid1,'FramesPerTrigger',1);
 start(vid1);
 imageData1=getdata(vid1,1);
 imageData=ycbcr2rgb(imageData1);
 imagesc(imageData(:,:,:,1));
end
Shai
  • 111,146
  • 38
  • 238
  • 371
MMH
  • 1,676
  • 5
  • 26
  • 43
  • maybe this is related to the bug... Did you try to explicitly specify the MEX-function as dependency in `deploytool`? May I ask what is the MEX-function that is failing? – Amro Jun 27 '13 at 06:17
  • See: http://www.mathworks.com/help/compiler/application-deployment-products-and-the-deployment-tool.html#bsfsqxk – Amro Jun 27 '13 at 06:22
  • I did not use the deploy tool, I used just the mcc command....ITs just a test mex file which takes a camera input and display the image. I tried many other mex files wich works well only the file having camera input is failing. – MMH Jun 27 '13 at 06:35
  • 1
    read the link above, you can specify files to be directly added using `mcc -a somefile ...`. Still I'm not sure what the problem is.. Is this MEX-file linked against other external shared libraries? Can you post the source of the MEX-file if it is a simple function? – Amro Jun 27 '13 at 06:42
  • ok i am posting the code – MMH Jun 27 '13 at 06:58
  • @Amro so what do I need to add ? – MMH Jun 27 '13 at 07:10
  • ok supposedly MATLAB Compiler [suports](http://www.mathworks.com/products/compiler/supported/compiler_support.html) deploying `videoinput` function from Image Acquisition toolbox, although I found a page about a bug which was fixed in later versions: http://www.mathworks.com/support/solutions/data/1-SKYXA.html?solution=1-SKYXA – Amro Jun 27 '13 at 07:22
  • I'm afraid I don't know what the problem is. I am on Windows so I cannot reproduce this, plus I dont have a webcam on this machine. Perhaps you should contact TMW technical support – Amro Jun 27 '13 at 07:36
  • @Amro thanks for your support...if somehow I fix the problem I will let you know. – MMH Jun 27 '13 at 07:40

1 Answers1

1

I was getting the same Depfun error, "What() is: ..", under R2013a on Linux but no errors when using a different OS or an older MATLAB version to compile my code. Following the bug report you linked to fixed it for me.

In the zip file linked to in the bug report you'll find a depfun.opts file. Rename or move your original depfun.opts file that's located in [matlabroot]/toolbox/compiler and copy the new one in its place.

Putting the new depfun.opts file in place is all it took for me to be able to compile using R2013a on Linux.

Also note, the bug report says that it could be caused by the importdata function or the Parallel Computing Toolbox but I'm not using either of those.

Jason
  • 28
  • 3
  • yes I also got an email from the Matlab server sying it was a bug and I replaced the my depfun.opts file and it is working fine. – MMH Jul 02 '13 at 03:00