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?
![]()
RRUZ
135k20 gold badges356 silver badges483 bronze badges
asked Aug 7, 2012 at 17:45
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.
answered Aug 7, 2012 at 18:01
DiegoDiego
7,2725 gold badges31 silver badges38 bronze badges
14
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.
answered Feb 17, 2015 at 10:45
bvjbvj
3,26431 silver badges29 bronze badges
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 :
- open the windows task manager
- Go to the ‘Processes’ tab
- click on the ‘Show processes from all users’ and Your exe will appear
- Choose it and press the ‘End Process’ button
And everything will be alright.
![]()
bummi
27.1k14 gold badges62 silver badges101 bronze badges
answered Jan 29, 2015 at 8:00
2
Try removing Castalia if you are using it. I spent 3 days trying to solve this problem, everything I could think of…file permissions, watching the file handles with process explorer. If I install Castalia 2013.3.4, the problem happens (I have steps to reproduce), and uninstalling it makes the problem go away.
Additionally, the IDE will crash if you have a ‘default debug desktop’ set, and try to run under the debugger using any other saved layout. (crash happens on the switch to the debug desktop).
answered Jul 29, 2013 at 0:41
2
I right clicked the application (in the project group window) and then selected CLEAN.
I was then able to compile the application.
answered May 7, 2014 at 16:17
In my case Problem solved by excluding project folder from antivirus real time protection.
Can you delete EXE file manually?If no , proccess is in memroy , Open task manager ,select your project, END task . you have some bug in code that prevents application terminate.
If it is not in process list , Then Try :
1-exclude folder from windows Indexing or 3rd party file search applications that index files
2-In windows seven activate application experince service
3-Exclude project folder from Anti virus realtime protection
UPDATE
I noticed that ,Even if you do all what i said above, you may get this error some times in Windows 7 randomly.specially when you compile project many times…first compiles will be OK but after ten or more times this problem will be occurred
answered Dec 8, 2017 at 7:21
![]()
answered Nov 30, 2018 at 15:42
MohsenBMohsenB
1,63918 silver badges29 bronze badges
1
Sometimes Microsoft Security Essentials holds the file after it was build in Delphi and you need to turn off real time protection.
To check which process holds the file, use Sysinternals Process Explorer: link. Use «Find handle» and type your exe name.
answered Oct 21, 2015 at 12:35
In my case it was due to the output folder that did not exist.
So what you can try is go to Project-> Options and under the Directories tab, change the output directory to a folder that exists and try again.
answered Feb 23, 2016 at 13:50
- Try to open the windows task manager
- go to process if you can not find your app in here
- then go to details tab you will find it.
I had the same problem and then I found it on details tab.
![]()
Dharman♦
30.5k22 gold badges85 silver badges133 bronze badges
answered Nov 14, 2019 at 4:22
1/29/2020: During the past week, I experienced this: Load a project in Delphi 7 on a Win 10 machine, compile it (successfully), run the project from inside of D7 (successful), recompile the project and get a «cannot create ….project1.exe». Upon reboot, can successfully compile and execute, but the second compile fails as the above.
I found that Dell Support Assist had an update 8 days ago (about the time this started), so I uninstalled it. After that, no problems with D7.
answered Jan 29, 2020 at 14:12
A solution that has worked for me, change project options -> Linking and leave it like that, then delete the executable manually and solved.Project options -> linking
answered Apr 22, 2020 at 7:04
![]()
Just save project as in another place. it works for me.
answered Sep 16, 2021 at 10:06
0
I seem to have fixed it by setting the compatibility mode to XP SP3. This also fixed another annoyance which made Alt-P not open bring up the Project menu.
EDIT: I didn’t have to re-enable my Application Experience. Still dead where it should be 
Right-click on your Delphi short-cut, Properties, then choose the Compatibility tab. Choose Run the program in compatibility mode for: Windows XP (Service pack 3).
(I also checked the Run this program as an administrator box, but you may choose not to do that.)
(This is for Delphi 7, as per the OP’s question, not for XE7, although it may work for that too.)

answered Nov 4, 2015 at 9:53
1
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?
![]()
RRUZ
135k20 gold badges356 silver badges483 bronze badges
asked Aug 7, 2012 at 17:45
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.
answered Aug 7, 2012 at 18:01
DiegoDiego
7,2725 gold badges31 silver badges38 bronze badges
14
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.
answered Feb 17, 2015 at 10:45
bvjbvj
3,26431 silver badges29 bronze badges
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 :
- open the windows task manager
- Go to the ‘Processes’ tab
- click on the ‘Show processes from all users’ and Your exe will appear
- Choose it and press the ‘End Process’ button
And everything will be alright.
![]()
bummi
27.1k14 gold badges62 silver badges101 bronze badges
answered Jan 29, 2015 at 8:00
2
Try removing Castalia if you are using it. I spent 3 days trying to solve this problem, everything I could think of…file permissions, watching the file handles with process explorer. If I install Castalia 2013.3.4, the problem happens (I have steps to reproduce), and uninstalling it makes the problem go away.
Additionally, the IDE will crash if you have a ‘default debug desktop’ set, and try to run under the debugger using any other saved layout. (crash happens on the switch to the debug desktop).
answered Jul 29, 2013 at 0:41
2
I right clicked the application (in the project group window) and then selected CLEAN.
I was then able to compile the application.
answered May 7, 2014 at 16:17
In my case Problem solved by excluding project folder from antivirus real time protection.
Can you delete EXE file manually?If no , proccess is in memroy , Open task manager ,select your project, END task . you have some bug in code that prevents application terminate.
If it is not in process list , Then Try :
1-exclude folder from windows Indexing or 3rd party file search applications that index files
2-In windows seven activate application experince service
3-Exclude project folder from Anti virus realtime protection
UPDATE
I noticed that ,Even if you do all what i said above, you may get this error some times in Windows 7 randomly.specially when you compile project many times…first compiles will be OK but after ten or more times this problem will be occurred
answered Dec 8, 2017 at 7:21
![]()
answered Nov 30, 2018 at 15:42
MohsenBMohsenB
1,63918 silver badges29 bronze badges
1
Sometimes Microsoft Security Essentials holds the file after it was build in Delphi and you need to turn off real time protection.
To check which process holds the file, use Sysinternals Process Explorer: link. Use «Find handle» and type your exe name.
answered Oct 21, 2015 at 12:35
In my case it was due to the output folder that did not exist.
So what you can try is go to Project-> Options and under the Directories tab, change the output directory to a folder that exists and try again.
answered Feb 23, 2016 at 13:50
- Try to open the windows task manager
- go to process if you can not find your app in here
- then go to details tab you will find it.
I had the same problem and then I found it on details tab.
![]()
Dharman♦
30.5k22 gold badges85 silver badges133 bronze badges
answered Nov 14, 2019 at 4:22
1/29/2020: During the past week, I experienced this: Load a project in Delphi 7 on a Win 10 machine, compile it (successfully), run the project from inside of D7 (successful), recompile the project and get a «cannot create ….project1.exe». Upon reboot, can successfully compile and execute, but the second compile fails as the above.
I found that Dell Support Assist had an update 8 days ago (about the time this started), so I uninstalled it. After that, no problems with D7.
answered Jan 29, 2020 at 14:12
A solution that has worked for me, change project options -> Linking and leave it like that, then delete the executable manually and solved.Project options -> linking
answered Apr 22, 2020 at 7:04
![]()
Just save project as in another place. it works for me.
answered Sep 16, 2021 at 10:06
0
I seem to have fixed it by setting the compatibility mode to XP SP3. This also fixed another annoyance which made Alt-P not open bring up the Project menu.
EDIT: I didn’t have to re-enable my Application Experience. Still dead where it should be 
Right-click on your Delphi short-cut, Properties, then choose the Compatibility tab. Choose Run the program in compatibility mode for: Windows XP (Service pack 3).
(I also checked the Run this program as an administrator box, but you may choose not to do that.)
(This is for Delphi 7, as per the OP’s question, not for XE7, although it may work for that too.)

answered Nov 4, 2015 at 9:53
1
|
1 / 1 / 0 Регистрация: 06.11.2013 Сообщений: 22 |
|
|
1 |
|
|
05.06.2014, 20:03. Показов 24908. Ответов 17
При компиляции программы в окне Unit1.pas пишет: [Fatal error] Could not create output file ‘путь’
0 |
|
351 / 344 / 279 Регистрация: 21.05.2013 Сообщений: 1,312 |
|
|
05.06.2014, 20:13 |
2 |
|
невозможно создать файл
0 |
|
4896 / 2766 / 851 Регистрация: 04.10.2012 Сообщений: 10,076 |
|
|
05.06.2014, 20:15 |
3 |
|
Лада Келлер, у Вас ранее скомпилированная программа не висит в процессах? Добавлено через 1 минуту
1 |
|
1 / 1 / 0 Регистрация: 06.11.2013 Сообщений: 22 |
|
|
05.06.2014, 20:16 [ТС] |
4 |
|
droider, где и как это посмотреть?
0 |
|
4896 / 2766 / 851 Регистрация: 04.10.2012 Сообщений: 10,076 |
|
|
05.06.2014, 20:20 |
5 |
|
Лада Келлер, откройте диспетчер задач и в списке процессов посмотрите, есть ли там ранее запущенный exe. Добавлено через 1 минуту Не по теме:
среду программирования второй раз в жизни вижу хорошее начало. Многие после первого раза больше не открывают.
2 |
|
1 / 1 / 0 Регистрация: 06.11.2013 Сообщений: 22 |
|
|
05.06.2014, 21:30 [ТС] |
6 |
|
Нет, не висит Добавлено через 1 час 0 минут
0 |
|
4896 / 2766 / 851 Регистрация: 04.10.2012 Сообщений: 10,076 |
|
|
05.06.2014, 21:57 |
7 |
|
Лада Келлер, этот файл формируется при компиляции. Обычный exe.
0 |
|
1 / 1 / 0 Регистрация: 06.11.2013 Сообщений: 22 |
|
|
05.06.2014, 22:11 [ТС] |
8 |
|
droider, но я ни разу до этого ничего не запускала
0 |
|
пофигист широкого профиля 4662 / 3096 / 855 Регистрация: 15.07.2013 Сообщений: 17,867 |
|
|
05.06.2014, 22:19 |
9 |
|
Could not create output file ‘путь’ ‘путь’ покажи.
0 |
|
1 / 1 / 0 Регистрация: 06.11.2013 Сообщений: 22 |
|
|
05.06.2014, 22:22 [ТС] |
10 |
|
northener, ‘C:Program files(x86)BorlandDelrhi7ProjectsProject1.exe’
0 |
|
пофигист широкого профиля 4662 / 3096 / 855 Регистрация: 15.07.2013 Сообщений: 17,867 |
|
|
05.06.2014, 22:28 |
11 |
|
C:Program files Нет прав для записи в эту папку.
0 |
|
1 / 1 / 0 Регистрация: 06.11.2013 Сообщений: 22 |
|
|
05.06.2014, 22:33 [ТС] |
12 |
|
Нет прав для записи в эту папку. Почему нет? И что делать?
0 |
|
пофигист широкого профиля 4662 / 3096 / 855 Регистрация: 15.07.2013 Сообщений: 17,867 |
|
|
05.06.2014, 22:40 |
13 |
|
Решение
Почему нет? И что делать? Потому что начиная с Windows Vista пользовательским программам это запрещено.
1 |
|
1 / 1 / 0 Регистрация: 06.11.2013 Сообщений: 22 |
|
|
05.06.2014, 23:12 [ТС] |
14 |
|
northener, спасибо, помогло!
0 |
|
0 / 0 / 0 Регистрация: 01.04.2015 Сообщений: 5 |
|
|
19.01.2016, 01:29 |
15 |
|
А что делать если сохранил не на «С» а просто на «D» и программа раньше работало, но спустя месяц она выдало эту ошибку «fatal error could not create output file» и потом просто весит в диспетчере пока не перезагрузишь, хотя раньше не открывал и в диспетчере не висела???
0 |
|
пофигист широкого профиля 4662 / 3096 / 855 Регистрация: 15.07.2013 Сообщений: 17,867 |
|
|
19.01.2016, 02:01 |
16 |
|
А что делать если сохранил не на «С» а просто на «D» и программа раньше работало, но спустя месяц она выдало эту ошибку «fatal error could not create output file» и потом просто весит в диспетчере пока не перезагрузишь, хотя раньше не открывал и в диспетчере не висела??? Если сам не в состоянии найти свои ошибки, прикладывай проект к сообщению. Буде время — поможем.
0 |
|
0 / 0 / 0 Регистрация: 01.04.2015 Сообщений: 5 |
|
|
19.01.2016, 17:56 |
17 |
|
Проект не причем — он полностью рабочий (проверял на других ПК). дело в самой делфи или возможно с ПК. перепробовал многое, все равно не работает. может что посоветуете..
0 |
|
4896 / 2766 / 851 Регистрация: 04.10.2012 Сообщений: 10,076 |
|
|
19.01.2016, 18:06 |
18 |
|
может что посоветуете без проекта можно только гадать на основе Ваших слов о том, что
Проект не причем
0 |
If you are receiving the message «Fatal Error: Could not create output file ‘C:Program FilesBorlandDelphi7ProjectsProject1.exe'» when trying to run Delphi 7 on Windows 7, fear not, as we have a workaround solution. Follow the steps below.
The easiest solution is to avoid installing Delphi in C:Program Files.
-
Alternatively go to Delphi installation directory :
- C:Program FileBorlandDelphi folder
- Look for the Bin directory
- Right-click on Properties > Security.
- Select your user and «Allow Full Control to Permissions«
Any more Windows 7 questions? Check out our forum!
Go Up to Error and Warning Messages (Delphi)
The compiler could not create an output file. This can be a compiled unit file (.dcu ), an executable file, a map file or an object file.
Most likely causes are a nonexistent directory or a write protected file or disk.
Reasons why an output file could not be produced:
- You don’t have the required write permission for the directory.
- Check the access privileges of your application.
- Make sure your source is not on a read-only drive.
- The linker (RLink) has generated an error, possibly due to finding unexpected versions of the .dcu, .bpl, and .dcp files
- The process (.exe) is locked by another process. For example, in debug mode, the debugger typically locks the executable.


Сообщение было отмечено Лада Келлер как решение