MATLAB: Do I receive the error “Failed to decrypt file” when running a stand-alone executable generated by MATLAB Compiler 4.0 (R14)

alonecompilerdecryptfailedMATLAB Compilermatlabrcmccstand

I have used MATLAB Compiler 4.0 (R14) to successfully generate a stand-alone executable. However when I attempt to run my executable, I receive the following message:
Failed to decrypt file.
The MATLAB file
...\<proj_name>_mcr\toolbox\compiler\deploy\matlabrc.m"
cannot be executed.
Additionally, on the Windows platform, I receive a Windows dialog box with the following error message:
Microsoft Visual C++ Runtime Library
Runtime Error!
Program: C:\RCtest.exe
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Best Answer

This error generally indicates that the CTF archive file was created in a different MCC compilation from that of the stand-alone executable.
To correct this issue, refer to the following steps:
1. Remove both the executable and CTF-files from your system.
2. Recompile your application using the MATLAB Compiler's MCC command.
3. Copy new executable and CTF-files to your target machine.