Matconvnet error cl.exe not found

情到浓时终转凉″ 提交于 2019-12-06 07:15:52

install visual studio community edition ( it's the free edition ) (minwg compiler will not work) go to C:\Program Files (x86)\Microsoft Visual Studio search for cl.exe take the one appropriate for your computer architecture and copy it to the folder containing the matconvnet installation run mex -setup c++ and set it to visual studio and you're good to go

Unfortunately MatConvNet does not support MinGW compiler in the current version. On Windows, you need to install Microsoft Visual Studio. Nowdays you can download the community edition for free, e.g. here.

One of the reasons why MatConvNet does not support MinGW is that on windows it uses the GDI+ library to speed up reading image files. You can try to compile it using: vl_compilenn('EnableImreadJpeg', false)

cl.exe is a C++ compiler.

This message means that the program cannot find this file on your computer (either because it is actually not there, or because you did not indicate its location.)

If you actually have a C++ compiler and work with Windows, go to the properties of your PC -> advanced settings -> Environment Variables (Sorry if the names are not accurate, my computer is in French but should be something similar...). Here you will have a field called PATH with most probably some paths already set. Modify it by adding the path of you C++ compiler (the folder containing cl.exe) and reboot your computer (your change is not taken into account otherwise).

I do not know how to do for other OS...

Otherwise, you need to download a C++ compiler. Visual Studio is free and has one.

I have added the directory with cl.exe to my system PATH variable (you need to restart Matlab after that operation) and the compilation succeeded. The check_clpath() function was unable to find proper location of cl.exe, because it was trying to find executable in directory which does not exsist:

cl_path =

'C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\bin\amd64'

after adding the cl.exe dir to PATH variable, in my case:

C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64

the compilation succeeded.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!