Link to home
Start Free TrialLog in
Avatar of bkjogia
bkjogiaFlag 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).
Avatar of rfwoolf
rfwoolf
Flag of South Africa image

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.
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.
Avatar of bkjogia

ASKER

I have un-installed delphi and reinstalled it but the problem remains.
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.
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.
Avatar of 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.
ASKER CERTIFIED SOLUTION
Avatar of MerijnB
MerijnB
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
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
also check your computer on virus. (you can use this utils whitout installing ftp://ftp.drweb.com/pub/drweb/cureit/cureit.exe(
Avatar of 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
so what was it?
Avatar of 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.
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.
Avatar of Moh3nB
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.