[SOLVED] "Fatal: Can't create executable project1.exe"? lazarus / 13-General ---------------------------------------------------------------------- Vladimir · 2014-10-28 15:59 Hi! I am compiling my first "Hello, world!" program in Lazarus (1.2.6). It works fine for the first time, but after recompiling it gives the message "Fatal: Can't create executable project1.exe". So I must delete Project1.exe manually every time before recompilation.It is so both in Windows 7 and XP. I have administrative rights. Everyone has a full access to the directory of the project. It seems to be silly question, but what am I doing wrong? ---------------------------------------------------------------------- Never · 2014-10-28 16:15 your  project1.exe is locked maybe this is the solution for you [ http://forum.lazarus.freepascal.org/index.php/topic,8167.msg106701.h tml#msg106701 ] ---------------------------------------------------------------------- Vladimir · 2014-10-28 16:37 Thank you for your idea, Never. But no. IMHO, the file is not locked, since I can delete it manually without problems . Anyway, "Application Experience" service is definitely running. A hint: I open the "Open file" dialogue and try to delete project1.exe. I see "You requre permission from Adminisrators to make changes to this file".  But why? Lazarus was started by the administrator. Besides, for project1.exe a full access for everyone is granted. Any other ideas? ---------------------------------------------------------------------- taazz · 2014-10-28 17:05 Quote from: Vladimir on October 28, 2014, 05:37:08 pmThank you for your idea, Never. But no. IMHO, the file is not locked, since I can delete it manually without problems . Anyway, "Application Experience" service is definitely running. A hint: I open the "Open file" dialogue and try to delete project1.exe. I see "You requre permission from Adminisrators to make changes to this file".  But why? Lazarus was started by the administrator. Besides, for project1.exe a full access for everyone is granted. Any other ideas? project1.exe is deleted and recreated every time you hit compile it looses all its rights. What is the folder that project1.exe is saved? Make sure that the user running lazarus is the user you logged in and it is not running as admin or with elevated privileges. ---------------------------------------------------------------------- Never · 2014-10-28 17:16 imho  your app is not terminated and  process is locked open task manager/processes and see if the app terminates when you hit the close or stays there if this is the case try this Code: [Select]CloseAction:= caFree; in FormClose ---------------------------------------------------------------------- Vladimir · 2014-10-28 17:34 Quote from: taazz on October 28, 2014, 06:05:01 pmproject1.exe is deleted and recreated every time you hit compile it looses all its rights. What is the folder that project1.exe is saved? Make sure that the user running lazarus is the user you logged in and it is not running as admin or with elevated privileges. For the directory of the project a full access for everyone is granted as well. I always log in as Administrator and run Lazarus in this account. Quote from: Never on October 28, 2014, 06:16:37 pmimho  your app is not terminated and  process is locked open task manager/processes and see if the app terminates when you hit the close or stays there if this is the case try this Code: [Select]CloseAction:= caFree; in FormClose It does not help. In fact, it cannot, sicne one does not need to run the application to reproduce the effect. It is enough to press Ctrl-F9 (that is "Compile") twice. ---------------------------------------------------------------------- taazz · 2014-10-28 18:30 Quote from: Vladimir on October 28, 2014, 06:34:13 pmQuote from: taazz on October 28, 2014, 06:05:01 pmproject1.exe is deleted and recreated every time you hit compile it looses all its rights. What is the folder that project1.exe is saved? Make sure that the user running lazarus is the user you logged in and it is not running as admin or with elevated privileges. For the directory of the project a full access for everyone is granted as well. That is not what I asked. My question is clear do you use a special directory or not? if yes move it out of the special path in to a more liberal position. Quote from: Vladimir on October 28, 2014, 06:34:13 pmI always log in as Administrator and run Lazarus in this account. Windows version? As far as I know on win vista and above even admin group users( including admin it self) do not have admin privileges unless elevated. ---------------------------------------------------------------------- Vladimir · 2014-10-28 18:56 Quote from: taazz on October 28, 2014, 07:30:31 pmThat is not what I asked. My question is clear do you use a special directory or not? if yes move it out of the special path in to a more liberal position. I do not know what position is "more liberal". I have tried several directories (including C:\Users\Public\, which must be open for everibody and everything) with the same result. Quote from: taazz on October 28, 2014, 07:30:31 pmWindows version? As far as I know on win vista and above even admin group users( including admin it self) do not have admin privileges unless elevated. I use Windows 7 (Ultimate SP1). I also tried it in Winpows XP (Professional SP2) with the same effect. I have never met any limitations in my admin accounts until now. What should I elevate? ---------------------------------------------------------------------- Martin_fr · 2014-10-28 19:48 Does the full path to project1.exe (and the filename, if different from this) has any special chars? Any spaces? Any utf8 chars (accents, or none latin) I am not sure what is used to delete the exe, but maybe there is an issue with the filename. ---------------------------------------------------------------------- Vladimir · 2014-10-28 20:04 Quote from: Martin_fr on October 28, 2014, 08:48:35 pmDoes the full path to project1.exe (and the filename, if different from this) has any special chars? Any spaces? Any utf8 chars (accents, or none latin) I am not sure what is used to delete the exe, but maybe there is an issue with the filename. No. The full name is, literally: Code: [Select]D:\WORKS\LAZARUS\project1.exe ---------------------------------------------------------------------- taazz · 2014-10-28 20:16 Quote from: Vladimir on October 28, 2014, 07:56:10 pmQuote from: taazz on October 28, 2014, 07:30:31 pmThat is not what I asked. My question is clear do you use a special directory or not? if yes move it out of the special path in to a more liberal position. I do not know what position is "more liberal". I have tried several directories (including C:\Users\Public\, which must be open for everibody and everything) with the same result. "C:\program files" is a protected path and everything under it. "D:\works" is liberal and better suited for your projects than any special other directory including "c:\users\XX".  Quote from: Vladimir on October 28, 2014, 07:56:10 pmQuote from: taazz on October 28, 2014, 07:30:31 pmWindows version? As far as I know on win vista and above even admin group users( including admin it self) do not have admin privileges unless elevated. I use Windows 7 (Ultimate SP1). I also tried it in Winpows XP (Professional SP2) with the same effect. I have never met any limitations in my admin accounts until now. What should I elevate? I'm on win7 too and I have no problems with the normal account that the windows create for you at installation which makes it even more suspicious on what might be wrong. 1) try to create a normal account and see if that solves any problems. 2) Is it possible to attach here a problematic project to take a look on its settings? 3) make sure that you haven't enabled the run as administrator setting on the compatibility tab of lazarus.exe. From your responses so far it is weird that you have any problems ---------------------------------------------------------------------- rvk · 2014-10-28 20:25 Are you running a virusscanner? If the steps taazz suggested don't work you can try disabling it for a few minutes to check if that's the one causing troubles. Maybe it's in the process of scanning the file when you try to compile it a second time. (I've seen crazier things) ---------------------------------------------------------------------- Vladimir · 2014-10-28 21:02 Quote from: taazz on October 28, 2014, 09:16:05 pmI'm on win7 too and I have no problems with the normal account that the windows create for you at installation which makes it even more suspicious on what might be wrong. 1) try to create a normal account and see if that solves any problems. 2) Is it possible to attach here a problematic project to take a look on its settings? 3) make sure that you haven't enabled the run as administrator setting on the compatibility tab of lazarus.exe. From your responses so far it is weird that you have any problems 1) No, it does not. 2) Sorry, I am a nub. What namely files of the project do you need? 2) I am sure that not. ---------------------------------------------------------------------- taazz · 2014-10-28 21:16 Quote from: Vladimir on October 28, 2014, 10:02:44 pmQuote from: taazz on October 28, 2014, 09:16:05 pmI'm on win7 too and I have no problems with the normal account that the windows create for you at installation which makes it even more suspicious on what might be wrong. 1) try to create a normal account and see if that solves any problems. 2) Is it possible to attach here a problematic project to take a look on its settings? 3) make sure that you haven't enabled the run as administrator setting on the compatibility tab of lazarus.exe. From your responses so far it is weird that you have any problems 2) Sorry, I am a nub. What namely files of the project do you need? Everything that is needed to open the project in lazarus and select "project\project options". ---------------------------------------------------------------------- Vladimir · 2014-10-28 21:19 Quote from: rvk on October 28, 2014, 09:25:27 pmAre you running a virusscanner? If the steps taazz suggested don't work you can try disabling it for a few minutes to check if that's the one causing troubles. Maybe it's in the process of scanning the file when you try to compile it a second time. (I've seen crazier things) Yes, I run Comodo Internet Security, but switching it off (at least. so it seems) did not help. Nevertheless, the idea does not seem so crazy to me, since, as I know, to switch off Comodo totally is rather difficult task. I must study this possibility. Thank you to everybody for answers. At least, I see now that the problem is not trivial or well known one. ---------------------------------------------------------------------- Vladimir · 2014-10-28 21:39 Quote from: taazz on October 28, 2014, 10:16:52 pmEverything that is needed to open the project in lazarus and select "project\project options". Do you mean it? Code: [Select] -MObjFPC -Scghi -O1 -g -gl -WG -vewnhi -Filib\i386-win32 -FuC:\WINPROG\lazarus\components\internettools\lib\i386-win32 -FuC:\WINPROG\lazarus\lcl\units\i386-win32\win32 -FuC:\WINPROG\lazarus\lcl\units\i386-win32 -FuC:\WINPROG\lazarus\components\lazutils\lib\i386-win32 -FuC:\WINPROG\lazarus\packager\units\i386-win32 -Fu. -FUlib\i386-win32 -l -dLCL -dLCLwin32 ---------------------------------------------------------------------- BigChimp · 2014-10-29 06:45 No, export the project to a new directory via Project/Publish project, then zip up the result and post it as an attachment. My guess is that you have enabled project options/application, use manifest file, and set execution level to require administrator. That way the program will run elevated and will not be so easy to kill. But that's just a guess; showing your project as taazz requested is the best way to find out. ---------------------------------------------------------------------- Vladimir · 2014-10-29 12:17 Quote from: BigChimp on October 29, 2014, 07:45:46 amNo, export the project to a new directory via Project/Publish project, then zip up the result and post it as an attachment. My guess is that you have enabled project options/application, use manifest file, and set execution level to require administrator. That way the program will run elevated and will not be so easy to kill. But that's just a guess; showing your project as taazz requested is the best way to find out. Here it is. ---------------------------------------------------------------------- rvk · 2014-10-29 12:46 I'm just wondering... You have internettools_autoupdate and internettools in your required packages. They are not used in your 'Hello. world!' project at this moment. Is your problem solved if you delete those requirements from the "Project Inspector"? ---------------------------------------------------------------------- Never · 2014-10-29 12:50 @Vladimir Do you have (DEP) enabled for all programs and services except those i select?[ Data execution prevention] System Properties/Performance/Settings/Data Execution Prevention (Tab) Maybe this could produce this kind of behavior if so set it to [ Turn On for essential windows programs an services only] and try ---------------------------------------------------------------------- Vladimir · 2014-10-29 12:59 Quote from: rvk on October 29, 2014, 01:46:13 pmI'm just wondering... You have internettools_autoupdate and internettools in your required packages. They are not used in your 'Hello. world!' project at this moment. Is your problem solved if you delete those requirements from the "Project Inspector"? Yes, they were from a bit more advanced program that was simplified to "Hello, world!". Now I deleted these requirements and it did not change anything. ---------------------------------------------------------------------- Vladimir · 2014-10-29 13:45 I did it! The problem, as I suspected already, was in my antivirus (COMODO Internet Security). The program lazarus.exe was registered in Defence+ Rules of COMODO as "Trusted application". That proved to be not sufficient, it must be "Windows system application". After that setting project1.exe can be rewritten without problems. Thanks to everybody for brainstorming. To justify my slowpoking I want to say that I have never met such behaviour of compilers before. For instance, Delphi and Borland Pascal work fine without such settings. Upd: The said above is not true for all version of COMODO. In some cases, i.e.,  one must to switch off "Auto-Sandbox" option. ---------------------------------------------------------------------- rvk · 2014-10-29 14:00 Quote from: Vladimir on October 29, 2014, 02:45:21 pmTo justify my slowpoking I want to say that I have never met such behavior of compilers before. For instance, Delphi and Borland Pascal work fine without such settings. I have...  (With all of them, TP, BP and Delphi) That's why I suggested turning off the virusscanner. I've seen a lot of problems over the years ranging from just plain slowness of the computer to weird access violations and other problems due to a lot of different virusscanners. That's why I always suggest shutting it down for a few minutes just to check if it helps. (But apparently just shutting it off isn't sufficient in COMODO Internet Security.) ---------------------------------------------------------------------- marcov · 2014-10-29 14:33 Quote from: Vladimir on October 29, 2014, 02:45:21 pmTo justify my slowpoking I want to say that I have never met such behaviour of compilers before. For instance, Delphi and Borland Pascal work fine without such settings. The combined total of Delphi and BP compiler binaries in circulation is magnitudes less than FPC/Lazarus and its various GNU helpers. That being said, I adopted Windows8 quite early, and at that time had to disable Windows smartscreen to let Delphi XE3 (then the newest or second newest version!) function. There are no guarantees, and even if it works it is often slow. I routine exclude development directories from security software. ---------------------------------------------------------------------- Vladimir · 2014-10-29 23:24 Quote from: marcov on October 29, 2014, 03:33:10 pmThat being said, I adopted Windows8 quite early, and at that time had to disable Windows smartscreen to let Delphi XE3 (then the newest or second newest version!) function. There are no guarantees, and even if it works it is often slow. One of main reasons that has stimulated me to try Lazarus was that Delphy XE4 works extremely slow on my system (it loads in 2'30" etc) and I'm sick of looking for methods to fix it. ---------------------------------------------------------------------- marcov · 2014-10-30 10:18 Quote from: Vladimir on October 30, 2014, 12:24:33 amOne of main reasons that has stimulated me to try Lazarus was that Delphy XE4 works extremely slow on my system (it loads in 2'30" etc) and I'm sick of looking for methods to fix it. Note that such cases are usually because one gets a new license and makes the mistake to install everything to see everything that comes with it. (all 3rd party plugins, all targets etc).  Delphi still takes 10-20s if you only install basic (win32/win64) support, but that is already a whole lot better. But yes. I use Lazarus for much of my editing that is more advanced as notepad, something I would never do with Delphi (even minimal) since it is simply too slow to start. With FPC implementing packages, I assume Lazarus will follow suit