Why am I encountering the error "The process cannot access the file because it is being used by another process" when I compile an executable from MATLAB/Simulink?

96 views (last 30 days)
Why am I encountering the following issue when I am using a workflow in MATLAB/Simulink to generate an executable, for example using MATLAB Compiler:
The process cannot access the file because it is being used by another process.
When using one coder products like MATLAB Coder, Simulink Coder, or Embedded Coder, the error might look like this, depending on the external compiler being used:
mt.exe : general error c101008d: Failed to write the updated manifest to the resource of file "C:\path\test.exe".
The process cannot access the file because it is being used by another process.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 4 Jul 2023
This is an issue being encountered by the antivirus software locking access to the resulting executable while updating its manifest and is not caused by MATLAB itself.
To resolve this issue, make sure your antivirus software does not lock files within the output directory where the resulting executable is located. Contact your IT helpdesk for further assistance with this.
Alternatively, if you do not have access to turning off the anti-virus software, you can simply try to delete all of the files that are generated when compiling the executable and recompile again.
If there is no antivirus available in the system, then run MATLAB in Administrator mode.
If this does not work, try switching the compiler to MinGW instead of Visual Studio (or vice versa) when using coder workflows.

More Answers (0)

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Products


Release

R2010a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!