mex function error in Win32
조회 수: 9 (최근 30일)
이전 댓글 표시
I have an old mex function that is inside a dll running in Windows XP. When I run MatLab 5 the function works ok, but when I run MatLab R2007b it comes up with the following error:
??? Invalid MEX-file 'C:\myfile.dll':
C:\myfile.dll is not a valid Win32 application.
What does this mean, why does it work in MatLab 5 & not R2007b; what can be done about this?
댓글 수: 0
답변 (2개)
Wayne King
2011년 9월 28일
Hi, please see:
The section:
New File Extension for MEX-Files on Windows Systems
댓글 수: 0
Kaustubha Govind
2011년 9월 28일
It looks like your R2007b is a 64-bit installation, but you are attempting to load a 32-bit DLL/MEX file on it. You need to re-compile your MEX function as 64-bit binary. Alternatively, you need to install 32-bit MATLAB on your 64-bit machine (see here for caveats).
댓글 수: 2
Kaustubha Govind
2011년 9월 28일
Does your MEX-file attempt to load other DLLs? Perhaps the system path in the R2007b environment somehow does not contain the path to these additional DLLs. You can check it your DLL file has any dependencies by using Dependency Walker: http://www.mathworks.com/support/solutions/en/data/1-2KUXT0/index.html?solution=1-2KUXT0
참고 항목
카테고리
Help Center 및 File Exchange에서 Adding custom doc에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!