简体   繁体   English

在Delphi 10.1 Berlin中无法创建输出文件

[英]Could not Create Output file in Delphi 10.1 Berlin

When running my Delphi Project for the first time , it runs with no error. 第一次运行我的Delphi Project时,它没有错误运行。 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. 我正在使用Delphi 10.1 Berlin。

UPDATE 1: 更新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. 我知道删除.exe,检查可执行文件是否仍在任务管理器中运行并杀死进程是快速的解决方案。 But I want a permanent fix. 但是我想要一个永久的解决方案。

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. 在我看来,似乎很合理的是,您的代码中存在一个错误,这意味着在您尝试关闭该过程时该过程并未终止。

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). 您可能正在通过“不调试运行”按钮(绿色的大箭头Shift + Ctrl + F9)运行应用程序,而不是最好通过“运行”按钮(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. 这样,您不仅可以轻松地修复调试应用程序的错误,而且更重要的是,当您停止调试器(“停止”按钮)时,应用程序将关闭,并且可执行文件不再使用,因此您可以重新编译而不会再次显示该错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM