How can the mex-file error be resolved on my system?

I have MATLAB 2009a and my system is 64-bit. I am trying to run a script involving face detection code which was running ok in 32-bit system and Opencv 2.2 but when i tried to run it on my system the following error occurs:
Invalid mex-file:C/:.......path..... the specified module could not be found.
Error in Eigenface at 94: faces=facedetect('haarcascade_frontalface_alt.xml',ii(1:scale:end,1:scale:end))
Anyone having any idea please let me know asap. Thankyou.

Answers (2)

Jan
Jan on 18 Sep 2012
Edited: Jan on 18 Sep 2012
You have to compile MEX-files for 64 bit again if you want to rund it under a 64 bit Matlab.

4 Comments

jv89
jv89 on 19 Sep 2012
Edited: jv89 on 19 Sep 2012
hello! Thankyou for raising up this point. Can't there be any other solution than to recompile the files all over? Any software or library which can act as a midway path to it? Sorry if my question is vague.
No, there is no gateway function. But you can install the 32 bit version of Matlab under a 64 bit operating system without significant drawbacks - except for the limitation to 32-bit address space. Then you can use the mexw32 files.
Mine is 32 bit system, i recompiled the cpp file. still am getting invalid mex file, specified mex file could not found. what i should do?
Jan
Jan on 14 Mar 2013
Edited: Jan on 14 Mar 2013
@gowroju: Please do not highjack an exitsing thread to ask a new question. Otherwise the accept status gets weird and in a discussion nobody knows, which answer belongs to which question. So please open a new thread and delete this comment. And when you do this, add any details.
Kaustubha Govind
Kaustubha Govind on 14 Mar 2013
Edited: Kaustubha Govind on 14 Mar 2013
The error "specified module could not be found" typically indicates that the MEX-file is trying to load one or more DLLs that it is unable to find on your machine. Please use Dependency Walker to profile the MEX-file (which is actually in DLL format), to find what you're missing. Also, if the MEX-function was originally compiled using Visual Studio, you will need Visual Studio redistributables corresponding to that version. You need to find out which version of Visual Studio was used and install the right distributables - you should be able to figure this out using Dependency Walker.

This question is closed.

Asked:

on 18 Sep 2012

Community Treasure Hunt

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

Start Hunting!