MATLAB: Do I receive the error ‘Could not find include file “mclmcrrt.h”‘ when trying to compile a stand-alone application

bugMATLAB Compilerverboseversionwrong

I am trying to compile a simple application, but I receive the following error:
lcc preprocessor error: C:\Temp\test\src\test_main.c:11 Could not find include file "mclmcrrt.h"

Best Answer

This problem is caused by settings that were taken from a previous or newer MATLAB version that are not compatible with the current version you are using.
To work around this issue, regenerate your MATLAB Preferences.
To regenerate your MATLAB preferences, do the following:
1. Start MATLAB and type the following at the MATLAB command prompt:
prefdir
In MATLAB 7.0 (R14), the output should look like
C:\WINNT\Profiles\{username}\Application Data\MathWorks\MATLAB\R14 (on Windows)
/home/{username}/.matlab/R14 (on UNIX)
/Users/{username}/.matlab/R14 (on Mac)
This is where your "matlab.prf" file is located. Your path may be different depending on how your system is setup.
2. Make sure that MATLAB is closed and rename the preferences directory of your current MATLAB version and all older versions of MATLAB to something else. For example, in MATLAB 7.0 (R14), rename the directory R14 to R14old. If you also have MATLAB 6.5 (R13) installed on your computer, rename the R13 directory to R13old.
3. Reboot the machine after the predir is renamed and recreated.
4. Restart MATLAB. A new preferences directory will be created for the MATLAB version that is launched.
If this does not address the issue that you hoped it would, it is possible to restore your preferences by deleting the newly created directories (R14 and/or R13) and renaming the R14old and/or R13old directories to their original names (R14 and R13 respectively).