简体   繁体   中英

How to solve Invalid MEX file error In Matlab?

Every time I try to define a symbolic variable I get this error message

Invalid MEX-file 'C:\\Program Files\\MATLAB\\R2013a\\toolbox\\symbolic\\symbolic\\mupadmex.mexw64': C:\\Program Files\\MATLAB\\R2013a\\toolbox\\symbolic\\symbolic\\mupadmex.mexw64 is not a valid Win32 application.

please help :)

.mexw64 is the file extension for mex files that have been compiled for 64-bit systems.

If your Windows installation is 32 bit, or even if Windows is 64-bit but the Matlab install is 32-bit (check the task manager to verify the latter) then Matlab will be looking for .mexw32 files, compiled for 32-bit systems, instead. The message "...is not a valid Win32 application" seems to imply that this is the case. If so, you need to obtain or build a 32-bit version of your mex file.

This error is caused by missing lib. Please install lib based on link as below: http://www.microsoft.com/en-us/download/details.aspx?id=14632 Or http://www.microsoft.com/en-us/download/details.aspx?id=15336

this problem seemed independent of 32/64 bit machines or versions of windos to me. I could solve it several times by simply installing the 2012 or a higher version of Microsoft Visual C++ Redistributable.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM