Search code examples
matlabimage-processingmex

MATLAB Could not find the compiler "cl" on the DOS path


I'm using Matlab 2009b 64bit and I installed Microsoft Visual Studio 2008 Express for compiler (but it just installs in 32 bit in C:\Program Files (x86)\Microsoft Visual Studio 9.0\Microsoft Visual C++ 2008 Express Edition with SP1 - ENU). Then I mex a file in Matlab, it has error:

Error: Could not find the compiler "cl" on the DOS path. 
         Use mex -setup to configure your environment properly.

...MATLAB\BIN\MEX.PL: Error: Unable to locate compiler.

Anyone have this problem? Share your experiment to solve it. Thank you!


Solution

  • Finally, I solved this problem. The key is compiler 32bit(ex Microsoft Visual Studio 2008 Express) is not compatibility with Matlab 64bit. So, I remove Matlab 64bit and then install Matlab 32bit to solve this problem. This work awesome.