This error message is seen if the environment variable, MSVCDir, does not point to the correct location of the Visual Studio Installation.
To solve the issue, set MSVCDir to the ACTUAL location of your MSVC install as follows:
1. Make a copy of the "msvc71engmatopts.bat" file in the current working directory. Note that the "msvc71engmatopts.bat" file can be found under $MATLABROOT\bin\win32\mexopts\msvc71engmatopts.bat, where $MATLABROOT is the installation directory of MATLAB 7.0.4 (R14SP2). Also note that this file may not exist in those versions of MATLAB which do not support Microsoft Visual Studio .NET 2003.
2. Open the file in a text editor. In line 13, change the "MSVCDir" variable from:
to:
set MSVCDir=C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7
(where C:\Program Files is the directory that contains Microsoft Visual Studio .NET 2003)
In general, the directory is usually something like:
C:\Program Files\Microsoft Visual Studio <version>\VC<version>
In some versions of Visual Studio, the "VC" folder does not have a version number. The correct directory will contain a "bin" folder which is where the compiler is located (CL.EXE).
Best Answer