Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Fatal Error: Cannot create output file "project1.exe"

So for some time now I keep having this problem:

on windows 7 (64bit), with Delphi 7 and Delphi XE2, if from within the IDE, I compile a program, run it, stop it, change it and rerun it I get this error message:

[Fatal Error] Cannot create output file "project1.exe"

I have no clue to what causes this. I googled for more information, but I could not find a solution.

There are two workarounds: either wait a minute or two, or delete project1.exe manually. Needless to say, this is unworkable.

I do not have a virus scanner, and no virus. Have full access to related folders. Run everything as Administrator.

So what causes this? And what can I do to fix it?

like image 372
Marck Avatar asked Aug 07 '12 17:08

Marck


4 Answers

I found the solution. It appears that disabling the service "Application Experience" caused this. When disabled the task "system" will lock "any" executable for some time.

Re-enabling "Application Experience" is the solution.

Found via:

https://superuser.com/questions/260375/why-would-system-continue-locking-executable-file-handles-after-the-app-has-exit

like image 148
Marck Avatar answered Nov 10 '22 21:11

Marck


I have the feeling that when you try to rebuild the application, project1.exe is still running. Maybe it takes longer than it should to close. You can easily check by opening Task Manager and see if the process project1.exe is still active after you close the application.

like image 5
Diego Avatar answered Nov 10 '22 20:11

Diego


I'm on XE7 and occasionally experience the "Could not create output file" problem, f2039. Using sysinternals' Process Explorer, I discovered an android debug process (adb.exe) had a lien on the compiled binary. Not sure why; there's no android config in this particular win32 project I'm building. Anyway, killed adb.exe and all was good thereafter.

Some points. The target output directories were never being indexed. "Application Experience" mentioned elsewhere in this thread was running the entire time. And most of the time, I could manually delete the output binary despite XE7's complaints. I noticed at one point, however, I could not delete the binary via the shell which provided the opportunity to locate the offending adb.exe via Process Explorer.

like image 4
bvj Avatar answered Nov 10 '22 19:11

bvj


I faced the same problem and I solved it . It seems that in some unknown cases the exe application remains running .
The solution is simple . You must just follow the following steps :

  1. open the windows task manager
  2. Go to the 'Processes' tab
  3. click on the 'Show processes from all users' and Your exe will appear
  4. Choose it and press the 'End Process' button

And everything will be alright.

like image 3
Zaher Soboh Avatar answered Nov 10 '22 20:11

Zaher Soboh