mex function error in Win32
显示 更早的评论
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?
回答(2 个)
Wayne King
2011-9-28
0 个投票
Hi, please see:
The section:
New File Extension for MEX-Files on Windows Systems
Kaustubha Govind
2011-9-28
0 个投票
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 个评论
Steve
2011-9-28
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
类别
在 帮助中心 和 File Exchange 中查找有关 Adding custom doc 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!