Could not Create Output file in Delphi 10.1 Berlin

泪湿孤枕 提交于 2020-01-05 05:29:04

问题


When running my Delphi Project for the first time , it runs with no error. But the subsequent runs produces an error below:

[dcc32 Fatal Error] F2039 Could not create output file '.\Win32\Debug\Project1_p.exe'

I tried enabling my application Experience and setting it to automatic, as stated here with no luck. How to fix this permanently? Im using Delphi 10.1 Berlin.

UPDATE 1:

I know deleting the .exe, checking whether the executable is still running in the task manager and killing the process are the quick solutions. But I want a permanent fix.


回答1:


You probably are running your application through the Run Without Debugging button (big green arrow Shift+Ctrl+F9), instead of that you should better run it through the Run button (small green arrow inside of a windows F9).

This way not only you can easily fix errors debugging your application line to line, but more importantly, when you stop the debugger (Stop button) the application closes and the executable is no longer in use, so you can recompile without showing that error again.




回答2:


The quick fix that you are looking for does not exist. The compiler cannot write the output file if it is already being used as the executable for a running process.

The solution is to make sure that the process has terminated before you attempt to compile again. Quite plausible, it seems to me, is that there is a bug in your code that means that the process is not terminating when you attempt to close it.



来源:https://stackoverflow.com/questions/39221715/could-not-create-output-file-in-delphi-10-1-berlin

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!