Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error: Invalid MEX file, the specified module could not be found

Tags:

matlab

mex

I have compiled Mex file successfully on my laptop. But when I am running it, it says Invalid mex file 'c:\newfolder\filename.mexw32' The specified module could not be found.

System specification:  
OS: windows 7  
MATLAB 2010a  
Microsoft Visual Studio 2008.  

The same mex file is compiled and run successfully on my PC under XP SP3.

like image 991
anand Avatar asked Mar 11 '13 12:03

anand


2 Answers

This MathWorks support link suggests two possible reasons to your problem:

  1. You do not have all of the necessary libraries that the MEX-function is dependent upon.
  2. You are running a MEX-file on a different version of MATLAB than it was compiled on.

Either way, to locate the source of this error it says that you need to list all dependent library files and verify their existence in the system you're trying to run the MEX file on, and also recommends the Dependecy Walker as the tool to to do that.

like image 105
Eitan T Avatar answered Sep 30 '22 04:09

Eitan T


Do you you the mex file on another system than the one it is created on?

If so, then you need to install the Microsoft Visual C++ Redistributable on that machine.

like image 38
Nick Avatar answered Sep 30 '22 02:09

Nick