MATLAB: Do I receive errors when compiling with MEX in MATLAB 7.0.4 (R14SP2) using the Borland C/C++ Compiler 5.0 or 5.02

borlandc:\programcompilationcompilingMATLABmex

When I use the Borland C/C++ Compiler 5.0 or 5.02 with the command
mex yprime.c
I receive the following error:
Borland C++ 5.2 for Win32 Copyright (c) 1993, 1997 Borland International
Error: Could not find file 'Files\MATLAB704\extern\lib\win32\borland\bc50.cpp'
D:\PROGRAM FILES\MATLAB704\BIN\WIN32\MEX.PL: Error: Link of 'yprime.dll' failed.

Best Answer

The source of this error is a bug in the Borland C/C++ Compiler 5.0 and 5.0.2 that causes it to fail when called with files whose paths contain spaces. If MATLAB 7.0.4 (R14SP2) has been installed in a directory containing spaces, this error will occur. To work around this issue, install MATLAB to a directory which does not contain any spaces.