http://www.mathworks.com/support ... p;solution=1-1I5TNS
Subject:
Why do I get an error message regarding the "cl" compiler on the DOS path when compiling and linking engine programs in MATLAB 7.0.4 (R14SP2)?
Problem Description:
When I compile and link MATLAB Engine programs, MATLAB cannot find the compiler.
For example, type the following at the MATLAB command prompt:
optsFile = fullfile(matlabroot,'bin','win32','mexopts','msvc71engmatopts.bat');
compFile = fullfile(matlabroot,'extern','examples','eng_mat','engwindemo.c');
mex(compFile,'-f',optsFile)
The following error message occurs:
Could not find the compiler "cl" on the DOS path.
Use mex -setup to configure your environment properly.
D:\APPLICATIONS\MATLAB704\BIN\WIN32\MEX.PL: Error: Unable to locate compiler.
??? Error using ==> mex
Unable to complete successfully
Solution:
To solve the issue, set MSVCDir to the ACTUAL location of your MSVC install, for
example:
Make a copy of the "msvc71engmatopts.bat" file in the current working directory. Open and edit the file. In line 13, change the "MSVCDir" variable from:
set MSVCDir=%MSVCDir%
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) |