Avatar of bkjogia
bkjogia
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Delphi Fatal Error

I am using Delphi 7 professional version.  Recently, I get the error shown below: I am running this under windows XP.

[fatal error] could not create output file C:\......Project1.exe.

When i run any project for the first time, there is no error but as soon as i make a change in the code (even a  superficial change like deleting a semi colon and retyping it ). When i run the project again I get this error.
I have closed Delphi and tried deleting the Project1.exe - I get a message saying it cannot be deleted as it is being used by another program.  I have to restart the computer before I can run the project again. I have looked at the processes in windows task manager before and after the error - there is no change in the processes or the number of processes.  This problem has started recently(1 week).
Delphi

Avatar of undefined
Last Comment
Moh3nB

8/22/2022 - Mon
rfwoolf

Hmm... when you compile and run a project and you then want to terminate the application, do you go to Project Reset (set delphi as the active application and press Ctrl + F2) or do you terminate the application some other way?
Anyway, if your applications are being terminated in the correct way, I would suggest you re-install delphi.
2266180

what has changed in your pc recently? antivirus? or even a virus? (though I haven't seen one in ages, only worms and alike, but not the primitive viruses that infect programs.

do you run your project? say you create a new project with nothing on it but what delphi generates. compile. project1.exe is beeing generated. modify something, compile again. does it fail? if so, get filemon (http://technet.microsoft.com/en-us/sysinternals/bb896642.aspx) and see what program access your file *you can set up various filters so that you don't get every file access in case there are a lot.
bkjogia

ASKER
I have un-installed delphi and reinstalled it but the problem remains.
Your help has saved me hundreds of hours of internet surfing.
fblack61
wd123

do you project close correctly ? try this:
open your project, press ctrl+F9, then run exe file manually and try to close it and then try to delete it.
rfwoolf

wd123's suggestion is good. Also when you compile and run your application through delphi (automatically) and you then close the application and close delphi and say you can't delete it -- make sure that delphi still isn't running in the task manager, as this would indicate that delphi wasn't fully terminated and has locked the file - which would explain why you can only delete the file after reboot.
bkjogia

ASKER
Thanks for replying.  I have tried following wd123's advice but the problem still exists. I printed all the processes running before and after the delphi problem and they are identical.  I have downloaded filemon and am trying it out but there is so much happening.  I will filter some processes and see what happens.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ASKER CERTIFIED SOLUTION
MerijnB

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Geert G

I have this same problem some times.  Usually after running some days without rebooting.
The solution i found to work the most was to reboot.  Then delete the exe file.
This usually does it. If not deleting the .map file too if it exists.
I found this sometimes happens after the computer time changed like sync with atomic clock
Geert G

Next to that it looks like you have a virus infecting your exe files.
I use process explorer to kill the culprit.
http://www.microsoft.com/technet/sysinternals/Security/ProcessExplorer.mspx
wd123

also check your computer on virus. (you can use this utils whitout installing ftp://ftp.drweb.com/pub/drweb/cureit/cureit.exe(
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
bkjogia

ASKER
Thanks very much for pointing out the unlocker.  I have spybot installed and the teatimer.exe was the locking the project1.exe and so every time I made a change to my project, even a superficial change, the project.exe could not be replaced/updated as teatimer had locked it.  This has not happened before.  I updated spybot in the last week and this must have something to do with it
2266180

so what was it?
bkjogia

ASKER
Using unlocker I was able to detect that teatimer.exe (spybot) was locking any project that I was trying to run after making superficial changes to to it(project). I uninstalled spybot and then reinstalled it and the problem is gone.  Many thanks to all those experts who made very valuable suggestions.  I have learnt a lot from overcoming this problem.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
rfwoolf

haha... Now I know not to make the same mistake. I have spybot installed (I run it very occasionally - once or twice a year) but I make a point to disable teatimer because to me that's just overkill.
Moh3nB

Watch this link :
How to fix Error : [dcc32 Fatal Error] F2039 Could not create output file X

Only you most put this command to all projects.