Skip to Main Content Skip to Search
Home |   Select Country  Choose Country  |  Contact Us  |  Cart Store 
Create Account | Log In
Products & Services Solutions Academia Support User Community Company
spacer spacer spacer spacer spacer spacer

Technical Solutions

Why do I receive an error message when I try to choose Microsoft Visual C++ 2005 Express Edition compiler using MEX -SETUP?


Date Last Modified: Friday, June 26, 2009
Solution ID:   1-66BY08
Product:   MATLAB
Reported in Release:   No Release
Platform:   Windows
Operating System:   Windows XP
 

Subject:

Why do I receive an error message when I try to choose Microsoft Visual C++ 2005 Express Edition compiler using MEX -SETUP?

Problem Description:

I am trying to choose Microsoft Visual C++ 2005 Express Edition compiler on a 32-bit Windows machine, using 'mex -setup' as follows
Please choose your compiler for building external interface (MEX) files

Would you like mex to locate installed compilers [y]/n?

Select a compiler:
[1] Lcc-win32 C 2.4.1 in C:\PROGRA~1\MATLAB\R2007b\sys\lcc
[2] Microsoft Visual C++ 2005 Express Edition in C:\Program Files\Microsoft Visual Studio 8

[0] None

Compiler: 2

Please verify your choices:

Compiler: Microsoft Visual C++ 2005 Express Edition
Location: C:\Program Files\Microsoft Visual Studio 8

Are these correct?([y]/n):
However, I get the following error message

*****************************************************************************
Error: The Microsoft Platform Software Development Kit (SDK) was not found.

Microsoft Visual C++ 2005 Express Edition requires that the SDK is
installed properly. MEX uses the environment variable "MSSdk" to
find the SDK. If it is installed properly, please verify that the
environment variable "MSSdk" points to the correct location.
Otherwise, install the SDK and try again.
*****************************************************************************

Trying to update options file: C:\Documents and Settings\yair\Application Data\MathWorks\MATLAB\R2007b\mexopts.bat
From template: C:\PROGRA~1\MATLAB\R2007b\bin\win32\mexopts\msvc80freeopts.bat "

Solution:

Microsoft Platform SDK for Windows Server 2003 also needs to be installed when using Microsoft Visual C++ 2005 Express Edition.

In addition, the MSSdk variable needs to be defined in the Windows environment when using Microsoft Visual C++ 2005 Express Edition with MATLABĀ® and related products. The value of this environment variable is the path to the installation directory for Microsoft Platform SDK for Windows Server 2003. This environment variable is not usually defined by the Microsoft Platform SDK installation program.

Please follow the steps listed below to setup the MSSDk environment variable after you have installed Microsoft Platform SDK for Windows Server 2003.

1. Go to Control Panel -> System -> "Advanced" -> "Environment variables".
2. Create a new system variable with the name "MSSdk".
3. The value of this variable should be the path where the Microsoft Platform SDK for Windows Server 2003 is installed.
4. Click OK a few times to close out the Control Panel window, and all its children.
5. Restart MATLAB.

You should now be able to use the Microsoft Visual C++ 2005 Express Edition compiler with MATLAB.

Please provide feedback to help us improve this Solution
Contact support
E-mail this page
Print this page