Why is 'mex -setup' unable to locate the Microsoft Platform SDK?

I have downloaded and installed the Microsoft Platform SDK (<http://www.microsoft.com/en-sg/download/details.aspx?id=15656>) on 64-bit Windows. However, when I run the command:
mex -setup
to select a compiler, MATLAB does not list this compiler as an option.

 Accepted Answer

The MSSdk variable needs to be defined in the Windows environment when using Microsoft Platform SDK with MATLAB® 7.2 (R2006a) to 7.7 (R2008b) and related products. The value of this environment variable is the path to the installation directory for Microsoft Platform SDK.
Running the Microsoft Platform SDK installer does not auto-set the required environment variable MSSdk.
Follow the steps listed below to setup the MSSdk environment variable after you have installed Microsoft Platform SDK.
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 is installed.
4. Click OK a few times to close out the Control Panel window, and all its children.
5. Restart MATLAB.
MEX -setup should now be able to locate the Microsoft Platform SDK to be used with MATLAB.
Alternatively, if MSSdk is not set, the command 'mex -setup' searches the system path for the name ''C:\Program Files\Microsoft Platform SDK" in order to locate it. If you installed the SDK in a directory with a different name, for example "C:\Program Files\Microsoft Platform SDK1", MEX will not be able to locate it.
To work around this issue without setting MSSdk, specify a compiler and its location manually, as follows:
1. Execute the command:
mex -setup
at the MATLAB command prompt.
2. Enter 'n' when asked if you would like mex to locate installed compiler. This will present you with a list of all the supported compilers for the current release of MATLAB.
3. Enter the number corresponding to the compiler that you want to use (In this case, Microsoft Platform SDK).
4. You will be presented with the default directory for the compiler. If this is not the installation directory of your compiler, select 'n' to prevent the MEX script from selecting that directory.
5.When prompted to enter the location of your compiler, enter the absolute path to the directory where the compiler has been installed.

6 Comments

Have the same issue with Visual Studio 2013.
What is the required System Variable?
Thank You.
Hi Royi,
This article is for older versions of MATLAB. Visual Studio 2013 Professional is supported as of R2014a(not for previous versions of MATLAB), as listed here:
If you are using R2014a with Visual Studio 2013, you should not even have to run mex -setup.
If you still have issues, please contact Mathworks Technical Support at support@mathworks.com
Alex, was your VS2013 possibly the Express version rather than the Professional version? VS2013 Professional should (in theory) be found by the tools automatically, but VS2013 Express would not be.
Sarah, what is the error message that you see when you execute "mex -setup"?
Rahimah binti Abdul Hamid, was it SDK 7.1 that you installed, or was it SDK 8 ?
SDK 8 is not supported by mex -setup in R2016a. SDK 7.1 is supported, if your operating system supports that.

Sign in to comment.

More Answers (0)

Categories

Products

Release

R2006b

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!