'cl.exe' is not recognized as an internal or external command,

23 次查看(过去 30 天)
Hello there,
Did anyone work with vlfeat library used in this tutorial : https://github.com/veda…/practical-object-category-detection ?
I passed to the step mentioned in the documentation
% Step 1.4: Apply the model to a test image
% -------------------------------------------------------------------------
im = imread('data/signs-sample-image.jpg') ;
im = im2single(im) ;
hog = vl_hog(im, hogCellSize) ;
scores = vl_nnconv(hog, w, []) ;
here the vl_nnconv(hog, w, []) ; function was having some error in its implementation, it was just a file that call another function called "vl_nnnotfound(mfilename);" and it has no arguments or any return value! but the function call has 3 arguments! so i altered the function to be as the attached file.
and it passed! but when calling the vl_nnnotfound function it return an error regarding the compiler of mingw-w64 with this error message:
'cl.exe' is not recognized as an internal or external command,
operable program or batch file.
Error using vl_compilenn>check_clpath (line 656)
Unable to find cl.exe
Error in vl_compilenn (line 426)
cl_path = fileparts(check_clpath()); % check whether cl.exe in path
I download the mingw-w64 compiler as a third party from the ads-on (matlab 2017b) and i find this compiler "TDM-GCC-64" but the same problem exists!!
Do I still have some error regarding its files and compilation with mingw-w64 compiler! they mentioned here : https://stackoverflow.com/questions/40226354/matconvnet-error-cl-exe-not-found
that i can use the Visual studio to use the cl.exe file in the path for comilation,
Does it work if i compiled it with visual studio?
NEED for HELP PLEASE!

回答(3 个)

Mohamed aymane Zizi
The solution I figured out is hardcoding the path link.
in vl_compilenn.m file you find the line
cl_path = fullfile(cc.Location, 'VC', 'bin', 'amd64');
so basically you changed accordinally to where cl.exe is located, in my case I changed it to this.
cl_path = 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64';
and worked perfectly!
wish that helps you!

Jan
Jan 2018-5-21
编辑:Jan 2018-5-21
vlfeat does not support the MinGW compiler. According to the List of supported compilers for Matlab R2017b you need either a professional version of MSVC 2012, 2013 or 2015, or the community version of MSVC 2017.
See also: https://www.mathworks.com/matlabcentral/answers/331523-unable-to-find-cl-exe-executing-vl_compilenn . Note that searching in the forum is useful in many cases.
  2 个评论
sana3 sal
sana3 sal 2018-5-21
I have installed the community version of visual studio 2017, but still have the same error! after installing, what i have to do?

请先登录,再进行评论。


Walter Roberson
Walter Roberson 2018-5-21
cl.exe not found usually means that you are trying to use a Visual Studio Express edition on a MATLAB version that needs the Professional edition.

Community Treasure Hunt

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

Start Hunting!

Translated by