This bug occurs when the Microsoft Visual C++ Compiler 6.0 is selected. To work around this issue:
1. Run the following command in MATLAB:
mbuild -setup
2. Select the compiler as prompted.
3. Type the following at the MATLAB command prompt:
cd(prefdir)
copyfile('compopts.bat','compopts_old.bat')
edit compopts.bat
4. Edit line 66 of compopts.bat to read
set IDL_COMPILER=midl /nologo /win32 /I C:\Progra~1\MATLAB71\extern\include
[Note: this specification assumes that MATLAB 7.1 has been installed in C:\Program Files\MATLAB71. Change this directory to match your particular installation directory, if different.]
5. Save the compopts.bat file.
6. Run the MCC command.
You must follow steps 1-6 whenever you change the compiler using MBUILD.
NOTE: It is advisable to install MATLAB in a directory without spaces.
Best Answer