MATLAB: Do I receive errors when compiling with MCC in MATLAB 7.0.4 (R14SP2)

applicationscc:\myc:\programcompilationcompilecompilerd:\mydirectoryfortranMATLABMATLAB Builder EXMATLAB Builder for COMMATLAB Compilermsmsvcplusspace

When I try to use the MATLAB Builder for COM or MATLAB Builder for Excel with the Microsoft Visual C++ Compiler 6.0, I receive the error
include
fatal error C1083: Cannot open source file: 'Files/MATLAB704/extern/include': No such file or directory
mwcomtypes.idl
Processing D:/Program Files/MATLAB704/extern/include/mwcomtypes.idl
midl : command line error MIDL1003 : error returned by the C preprocessor (2)
D:/PROGRAM FILES/MATLAB704/BIN/WIN32//../WIN32/MEX.PL: Error: IDL compile of 'mwcomtypes.idl' failed.
When I try to package a COM object using the MATLAB Builder for COM or MATLAB Builder for Excel with Microsoft Visual Studio .NET, an error dialog comes up with the error:
The system cannot find the file specified

Best Answer

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.