Pelles C forum

Pelles C forum => General discussion => Topic started by: J_A_Sturgess on August 08, 2018, 02:00:08 PM

Title: .exe files not being built for a project
Post by: J_A_Sturgess on August 08, 2018, 02:00:08 PM
My technical know-how regarding the inner workings of Pelles C is quite limited, but one thing I have picked up on is that upon building a standard C project (of the Win64 Console Program type) a .exe file is created, which is then run when the project is executed.

My problem lies with these .exe files, as after a while they simply stop being created when I press 'Build' (I have the folder where the project is located open to watch the file being created, or lack of file in the problematic cases). This started happening whilst I was using Version 9 of Pelles C, and as it was a beta I thought that this might just be a bug, so downloaded Version 8, to which the problem has reared its ugly head again. I have had this problem with two out of six different projects now, and it's becoming fairly annoying.

Any advice on how to remedy this would be most welcome.
Title: Re: .exe files not being built for a project
Post by: jj2007 on August 09, 2018, 01:40:40 AM
I have not seen this particular behaviour, but one reason could be that your programs do not exit properly. That happens every now and then with slighly incorrect GUI applications, and then the build process fails obviously.

Check with Task Manager if your project.exe is still active.
Title: Re: .exe files not being built for a project
Post by: DMac on August 09, 2018, 04:38:46 AM
I had a similar problem once and it was related to an antivirus app that detected the newly created executable and deleted it immediately!  I had to configure the app to whitelist Pelles C generated executables.
Title: Re: .exe files not being built for a project
Post by: frankie on August 09, 2018, 10:17:50 AM
Some "smart" antivirus (i.e. Kasperski) reacts also when you use some API functions (i.e. URLDownloadToFile()) and delete the executable.
Try pausing the antivirus and rebuilding your project.
If the exe is there AV is your problem.
Title: Re: .exe files not being built for a project
Post by: J_A_Sturgess on August 09, 2018, 12:18:25 PM
Thank you for the replies.

None of my project files are still open in Task Manager, so we can rule that one out, and the only anti-virus software I have (and this may sound a bit dodgy...) is the free version of Malwarebytes, which doesn't do real-time protection, so we can rule that out as well. I have added the folder where the projects are saved to the exclusion list on both Malwarebytes and the Windows Defender app though just to make sure.

All may not seem totally lost however, as I believe I have found the cause of the problem! As I've no common sense, I sometimes save two source code files that both include main() function tags to the same project, which means the build ends in 'complete failure'. It is deleting one of the files and then attempting to build the project again that causes the problem to appear, and the message 'Unable to execute project.exe. Invalid or unsupported executable format.' comes up, and no .exe file is present in the folder. So I guess the lesson here is that I just need to be careful with my saving!