Delphi keeping EXE locked; some links
Posted by jpluimers on 2016/07/12
For my own reference when coping with “[dcc32 Fatal Error] F2039 Could not create output file” which happens with a lot of Delphi versions:
- Deleting EXE works: I was wondering if anyone saw any of the following problems. Specifically, I’d….
Seems to happen more often when having a project group debugging various EXEs where bds.exe keeps handles open. - ADB keeps EXE locked: I was recently hit quite often by the “cannot create exe” error and was able to….
As a temporary measure (in the end you have to restart the IDE), I often use Process Explorer to force close the open handles from bds.exe to the EXE.
It also happens intermittently using Visual Studio, where devenv.exe keeps handles locked. Same Process Explorer trick applies there too.
You can do similar tricks with LockHunter or Handle.exe.
–jeroen






ozziSteve said
I develop using Seattle and Berlin on Win 7 hosted on a Macbook using Parallels. My preference is to have the project directories on a shared folder on the Mac and this has some implications that I use to my advantage:
I can run up two instances of the same Win32 or Win64 program which is useful for testing tethered apps. The .exe appears to be locked, preventing a full recompilation, but the IDE launches a second or third instance without a problem. On a regular Win 7 machine I’m preventing from launching a second instance. (I don’t think I have IDEFixpack loaded on Berlin.)
The only way to re-compile a FMX project for Android or iOS is to “Right-click Clear” the project prior to each compilation. Solution, change the output directory on the project options to C:\Temp\Somewhere for the iOS and Android configurations.
Also, I make sure any source control applications (Git & TMS…yes, I’m sometimes using both at the same time) are shut down. I’ve got a sneaky suspicion that these fella’s are monitoring the project directory and can occasionally cause locking issues.
jpluimers said
Thanks for the good comments.
Especially tooling that monitors directories can be a pain (including many anti-virus software), so I’ve banned those from my system except for
everythingwhich doesn’t operate on the file level.Yogi Yang said
I have been facing same problem for quite some time. I learned that using IDEFixPack seems to solve the problem.
jpluimers said
I was using IDEFixPack. With that it still occurs, but not as often.
Yogi Yang said
Ok then I think this Reg Entry will do the trick for your.
I was suggested by a user called SkyDevil.
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Embarcadero\BDS\14.0\Debugging\Embarcadero Debuggers\Evaluators]
“comp32x.dll”=”-1″
Put this in a .reg file and double click it to append it to the registery.
jpluimers said
So what’s this comp32x.dll for?
Yogi Yang said
To be frank. I don’t know at to what the hell comp32x.dll is for!
I have started using this reg patch and the problem has vanished… so I don’t think much about it… as I am already loaded with dearth of work to complete in limited period.
Jason Chapman said
just as an aside, VMWare does this a lot if your VM has a VMShared folder on the host and you put a file these, the host won’t be able to rename the file eventhough no process in the VM is touching it.
JRL said
Sometimes the exe file is locked by Windows File Explorer (explorer.exe) if you have one instance open viewing exe folder, specially if exe file is selected or visible in the list view.
I guess that it has some relation with automatic refresh of the icon by the list view when the file is modified after compilation+linking.
It usually stops to happen if other file is selected, the view is scrolled such as the exe file ceased to be visible, or other folder is displayed, but the best option is to close that file explorer instance.
I have also seen this same problem updating a WinZip self-extractor.
Yogi Yang said
JRL,
From my experience I can say that it is not Windows Explorer problem. It is Delhi IDE problem. To be specific it is the Debugger. If you change the setting of the IDE to generate debug symbol file separately from the exe you will observe that the thus generated .tds file seems to get locked up.