Steps for how to install the 2005 Express Edition Visual C/C++ as the backend mex compiler. This document is for you if:
You want to compile C mex files using the free Microsoft Visual C/C++ compiler that comes with Visual Studio 2005 Express Edition.
You want to be able to compile your mex file using the Matlab command line tool mex, rather than creating projects and compiling within the Visual Studio IDE.
You want to do this with zero hacking on the mex installation or on any mexopts.bat files.
the file does not exit
2007b with VC 2008 express, successful, thank you!
I successfully configured Microsoft Visual C++ 2008 Express Edition for version 2006a using the instructions given. Thank you so much for sharing this info.
Confirmed that Visual C++ 2008 Express works with Matlab 2008a (v7.6.0) by following these instructions.
The final step, running mex -setup, had no trouble finding the Visual C++ 2008 express compiler and mex is working for me now. Thank you!
Thank you so much for this extremely clear document! I have Matlab R2007a and wanted to use CPLEXINT (http://control.ee.ethz.ch/~hybrid/cplexint.php) to link with CPLEX, but I couldn't get the files compiled with lcc. Thanks to your document, I could compile them with MS C++ Compiler and things worked perfectly. Thank you so much!
I was able to configure Matlab R 2007b with Visual C++ 2008 using the step by step procedure. Thank you for uploading this file
Very helpful. Thank you for the painstaking effort to document all the steps so clearly. I used your procedure with Matlab R2007b and Microsoft Visual C++ 2008 Express Edition, and it worked perfectly.
As of the 2007a release, Matlab/mex now recognizes VC 2005 Express Edition as a supported compiler. Unfortunately, in the process they made changes which break the steps set out in the how-to, which was devised based on 2006a/b. (I believe the last post was referring to this fact.)
You still need to install VC Express and the Platform SDK (though the exact location of the latter may no longer be important).
CRITICAL: 2007a requires the Windows environment variable "MSSdk" which must contain the path to the SDK. A handy test to see which windows environment variables Matlab sees is to do
at the Matlab prompt.
For reference, you can see http://www.mathworks.com/support/tech-notes/1600/1601.html, in particular footnote 1.
I will update the how-to once I can get a copy of 2007a and test everything myself. Please email me with any questions in the meantime.
This seems to be great, but it doesn't work for me. I use Matlab 2007a and unfortunatly nothing is is working. When I type mex-setup and chose the visual C++ 2005 Espress, and I still get error about unknow MSSDK....
Or you could just edit the 'mssdk' environment variable to wherever you install the Platform SDK, and Matlab will look for it there
This solves my mex compiling problem.
Thank you for the advice.
wish i had read this before using the mex command... i think the moral is to right your own options file for mex so you can understand what directories to include, etc.
Using this free compiler solved all the problems I was having with that native matlab C compiler Lcc.
Updating the requirements to say that the how-to only works for 2006a/b, not 2007a.