mex File not Recognized

조회 수: 8 (최근 30일)
Marcelo Sena
Marcelo Sena 2015년 2월 7일
답변: James Tursa 2015년 2월 7일
Hi, I am using a MatLab 2013a 32-bit. I am trying to call a mex file 'SMAT_matlabcall.mexw32',but it gives me the error:
Invalid MEX-file
'C:\Users\...\SMAT_matlabcall.mexw32': The
specified module could not be found.
However, the mex file is indeed in the correct path. Since I just installed MatLab, maybe the issue was with mex setup. When trying to run
mex setup
I get the error:
C:\PROGRA~2\MATLAB\R2013A\BIN\MEX.PL: Error: 'setup' not found.
Error using mex (line 206)
Unable to complete successfully.
I have compilers installed in my computer since I am able to run mex files in a MatLab 64-bit version, but for other reasons I need to run these files in the 32-bit version.
Any help is appreciated. Thanks.

답변 (2개)

Jan
Jan 2015년 2월 7일
편집: Jan 2015년 2월 7일
The command for the setup is:
mex -setup
with the minus character.
Use the DependencyWalker to check, if the required run-time libraries are installed. Perhaps you have to install the MSVC run time libs in the 32 bit version in addition. See http://www.mathworks.com/matlabcentral/answers/95906-how-do-i-profile-my-exe-or-dll-file-with-dependency-walker
  댓글 수: 2
Marcelo Sena
Marcelo Sena 2015년 2월 7일
I managed to do the setup, but my original problema remains, that is, when I call the mex file MatLab tells me it cant find the file. Any hint?
Jan
Jan 2015년 2월 7일
편집: Jan 2015년 2월 7일
Do you mean the message "The specified module could not be found."? No, this does not mean, that the file is not found, but that a library is missing. So please post, if you have been able to compile the function successfully and if the DependencyWalker is satisfied.

댓글을 달려면 로그인하십시오.


James Tursa
James Tursa 2015년 2월 7일
As Jan has already pointed out, "The specified module could not be found" message means that the SMAT_matlabcall.mexw32 file itself is in fact found, it is just that there is a problem when attempting to run it.
In addition to a missing library, the error message can result when a mex routine compiled in one version of MATLAB is used in a different version of MATLAB (the MATLAB libraries used by the mex routine are incompatible). The only fix is to use the mex routine in the original version of MATLAB, or to recompile the mex routine in the new version of MATLAB.

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by