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?

26 次查看(过去 30 天)
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.

采纳的回答

MathWorks Support Team
编辑:MathWorks Support Team 2025-5-9
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, take the following steps:
  1. 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.
  2. 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.
  3. If there is no antivirus available in the system, then run MATLAB in Administrator mode. 
  4. If this does not work either, try switching the compiler to MinGW instead of Visual Studio (or vice versa) when using coder workflows.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息

产品


版本

R2010a

Community Treasure Hunt

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

Start Hunting!

Translated by