Why do I receive an error message regarding the "cl" compiler on the DOS path when compiling and linking engine programs with MATLAB 7.0.4 (R14SP2)?
8 ビュー (過去 30 日間)
古いコメントを表示
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
採用された回答
MathWorks Support Team
2013 年 6 月 11 日
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:
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)
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).
0 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Introduction to Installation and Licensing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!