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

后端 未结 4 870
滥情空心
滥情空心 2021-01-11 14:52

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 no

相关标签:
4条回答
  • 2021-01-11 14:55

    I had this problem also when upgrading from Matlab2010a/VS2008 to Matlab2013a/VS2010.

    All my environment variables were sent correctly. A reboot fixed problems with OpenCV dlls not being found, I assume that it was still trying to link to the OpenCV dlls for VS2008 (even though I had changed the path). However still my mex file could not find libmex.dll.

    When I installed Matlab2013a, I did not uninstall the old version (in case I wanted to go back). However that was the cause of my problem. Once I uninstalled the old version of Matlab and rebooted again, the problem was gone.

    0 讨论(0)
  • I had a similar problem. I was only linking against 1 'lib' so I simply copied that lib into the same folder as the mexw64 and it worked.

    I have not poked around for the correct place to tell MATLAB to add the lib's real location to whatever path it's looking at.

    0 讨论(0)
  • 2021-01-11 15:12

    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.

    0 讨论(0)
  • 2021-01-11 15:17

    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.

    0 讨论(0)
提交回复
热议问题