Technical Solutions
Why am I unable to execute a MEX-file created in MATLAB 7.2 (R2006a) with Visual Studio 2005 (8.0)?
Date Last Modified: 21 Jan 2008
| Solution ID: |
|
1-2223MW |
| Product: |
|
MATLAB |
| Reported in Release: |
|
R2006a |
| Fixed in Release: |
|
R2006a |
| Platform: |
|
Windows |
| Operating System: |
|
Windows Any |
Subject:
Why am I unable to execute a MEX-file created in MATLAB 7.2 (R2006a) with Visual Studio 2005 (8.0)?
Problem Description:
I tried to run a MEX-file that was created on another machine using MATLAB 7.2 (R2006a) and the Visual Studio 2005 (8.0) compiler. I received the following error:
??? Invalid MEX-file 'C:\myfiles\yprime.mexw32': This application has failed to start because the application configuration is incorrect. Reinstalling the application may fix this problem.
Solution:
This problem occurs because the machine where you are running the MEX-file does not have all required Visual Studio 2005 runtime libraries installed.
Microsoft supplies, with Visual Studio 2005, a self-extracting executable that installs the required libraries.
Some versions of MATLAB contain a copy of this executable file. The first version this file was shipped with was MATLAB 7.2 (R2006a). In MATLAB for Windows (32-bit), the file is named vcredist_x86.exe and is located in the directory $MATLAB\bin\win32. In MATLAB for Windows x64, the file is named vcredist_x64.exe and is located in the directory $MATLAB\bin\win64. In both cases, $MATLAB is the MATLAB root directory, as returned by typing
matlabroot
at the MATLAB command prompt.
To work around this issue, run the appropriate executable file to install the runtime libraries on each machine that runs the MEX-file. If you are using a MEX-file compiled on 32-bit Windows, you will need to run vcredist_x86.exe even if the target machine is running 64-bit Windows. Similarly, if the MEX-file was compiled on 64-bit Windows, you will need to install vcredist_x64.exe even if the target machine is running 32-bit Windows.
The runtime libraries are also available on Microsoft's website:
For VS 2005 vcredist_x86.exe: http://www.microsoft.com/downloads/details.aspx?familyid=32BC1BEE-A3F9-4C13-9C99-220B62A191EE&displaylang=en
For VS 2005 vcredist_x64.exe: http://www.microsoft.com/downloads/details.aspx?familyid=90548130-4468-4BBC-9673-D6ACABD5D13B&displaylang=en
For Visual Studio 2005 SP1, these files are available on Microsoft's website: For VS 2005 SP1 vcredist_x86.exe: http://www.microsoft.com/downloads/details.aspx?familyid=200B2FD9-AE1A-4A14-984D-389C36F85647&displaylang=en
For VS 2005 SP1 vcredist_x64.exe: http://www.microsoft.com/downloads/details.aspx?familyid=EB4EBE2D-33C0-4A47-9DD4-B9A6D7BD44DA&displaylang=en
If this does not resolve the problem there may be other required libraries missing. One way to identify this is to use Dependency Walker to identify any missing dependencies.
Please note that these runtime libraries are a requirement for all stand-alone deployments, starting release R2007a.
|
Related Solutions: