Why do I receive errors when compiling with MCC in MATLAB 7.0.4 (R14SP2)?
3 views (last 30 days)
Show older comments
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
Accepted Answer
MathWorks Support Team
on 27 Jun 2009
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.
0 Comments
More Answers (0)
See Also
Categories
Find more on MATLAB Compiler in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!