Pelles C forum

C language => Beginner questions => Topic started by: CProgrammer on June 30, 2023, 03:15:41 PM

Title: Strange problem with the IDE
Post by: CProgrammer on June 30, 2023, 03:15:41 PM
I have a strange problem with the code in the attached file.

If I start a new project in Pelle's IDE and add the two files TryIt.c and TryIt.rc to the project by selecting "Add files to project" from the "Project menu" then I can build an EXE file that runs as expected.

When I close the IDE and then run the project by double clicking on the .ppj file created by the above procedure, the IDE opens, but then when I try to build the EXE file the IDE crashes.

The crash file @@@FD60.tmp is blank.

Experimenting further, I found that if I close the IDE and delete the output folder, the .tag file, the .ppx file and the .exe file produced when building the program then

 - When I open the IDE,  open the project and build it then the .exe file compiles correctly
 
 or
 
 - If I double click on the project file to build it the IDE crashes.

How can I prevent the IDE from crashing? I am using Windows 11.
Title: Re: Strange problem with the IDE
Post by: frankie on June 30, 2023, 05:09:18 PM
It works for me. I'm on WIN10, but I don't think that it is an OS problem.
The issue happens for any project or for this one only?
Try to completely remove and reinstall PellesC as first try.
Title: Re: Strange problem with the IDE
Post by: CProgrammer on July 01, 2023, 09:42:34 AM
@frankie:

The problem seems to exist for this code only - I have some old programs that I wrote in Pelles C several years ago and they compile correctly.
I reinstalled Pelles C but this did not solve the problem.
Title: Re: Strange problem with the IDE
Post by: Robert on July 01, 2023, 11:29:00 AM
I have a strange problem with the code in the attached file.

If I start a new project in Pelle's IDE and add the two files TryIt.c and TryIt.rc to the project by selecting "Add files to project" from the "Project menu" then I can build an EXE file that runs as expected.

When I close the IDE and then run the project by double clicking on the .ppj file created by the above procedure, the IDE opens, but then when I try to build the EXE file the IDE crashes.

The crash file @@@FD60.tmp is blank.

Experimenting further, I found that if I close the IDE and delete the output folder, the .tag file, the .ppx file and the .exe file produced when building the program then

 - When I open the IDE,  open the project and build it then the .exe file compiles correctly
 
 or
 
 - If I double click on the project file to build it the IDE crashes.

How can I prevent the IDE from crashing? I am using Windows 11.

Confirmed. Windows 11.
Default Pelles C 12.0 installation to Program Files.
Project files to C:\Users\Robert\OneDrive\Documents\Pelles C Projects\TryIt
Can't even Clean the project. IDE crashes.

Windows 11 has been, for me, the greatest disappointment in operating systems since I started almost 40 years ago. I wont bother you with the litany of problems. Way beyond irritating.

Bought a new machine just to have Windows 11. An expensive freaking waste of money.

Fedora and OpenSuse run flawlessly on the new machine.

You know where this is heading.

Title: Re: Strange problem with the IDE
Post by: frankie on July 01, 2023, 05:47:00 PM
Windows 11 has been, for me, the greatest disappointment in operating systems since I started almost 40 years ago. I wont bother you with the litany of problems. Way beyond irritating.
Bought a new machine just to have Windows 11. An expensive freaking waste of money.
Fedora and OpenSuse run flawlessly on the new machine.
You know where this is heading.
That's why I stand with WIN10 and wait, as I made remaining on XP when VISTA appeared and WIN7 when WIN10 just come out.  >:(
The secret is wait for the testers to complete the cycle...  ;)

@CProgrammer I can't help more until I can't have a WIN11 machine at hands, The only suggestion is to check directories and permissions, maybe an issue of this kind...  :(
Title: Re: Strange problem with the IDE
Post by: John Z on July 01, 2023, 10:18:57 PM
Hi CProgrammer,

Can you use the Pelles IDE ZIP feature and post the complete ZIP project so that I've got everything the same?
I'm on Win11 and I'll take a look. I'll try the posted sources and a best guess on the compiler/linker options.

Meanwhile try changing the project files location to something like C:\temp\PellesC\files to see if it helps.

Thanks,
John Z
Title: Re: Strange problem with the IDE
Post by: John Z on July 01, 2023, 10:40:41 PM
Hi CProgrammer,

Did a best guess at settings: WIN 11, Pelles C V 12.002.  Attached is the project for you to test.
It all works OK for me, both methods.

Let me know the results for you.

John Z

PS. I agree WIN 10 was one of the best.  So far I have been quite successful with WIN 11 too, other than the too numerous to mention things one must turn off that MS has on by default.  And after every update they add new things to turn off.  But hey I ran Windows ME version ;( for many years.  :( :( :(

Also still run WIN 7 (very good) and WIN 10 -

Attachment was incomplete, see Roberts version posted below.
Title: Re: Strange problem with the IDE
Post by: Robert on July 03, 2023, 02:29:33 AM
Hi CProgrammer,

Did a best guess at settings: WIN 11, Pelles C V 12.002.  Attached is the project for you to test.
It all works OK for me, both methods.

Let me know the results for you.

John Z

PS. I agree WIN 10 was one of the best.  So far I have been quite successful with WIN 11 too, other than the too numerous to mention things one must turn off that MS has on by default.  And after every update they add new things to turn off.  But hey I ran Windows ME version ;( for many years.  :( :( :(

Also still run WIN 7 (very good) and WIN 10 -

Hi John:

I noticed that you did not include CProgrammer's TryIt.rc and MAINICON.ICO file.

CProgrammer's TryIt.rc file is encoded as UTF-16LE with a BOM.

I converted it to UTF-8 with a BOM and did a 64 bit compile. Seems O.K. now.

Attached is the zipped project.
Title: Re: Strange problem with the IDE
Post by: John Z on July 03, 2023, 03:47:06 AM
Oops, thanks Robert.

Good catch.  I should have been more careful  :(

John Z

P.S. Good to know 64 bit worked also, I just defaulted to 32 bit.
Title: Re: Strange problem with the IDE
Post by: CProgrammer on July 03, 2023, 05:26:09 PM
@John Z and frankie: Apologies for the delay in replying - I had not received an email notification that this thread had another post. Fortunately, the solution posted by Robert works.

Thanks, Robert, your solution did the trick. I'm not sure why the encoding of the *.rc file was incorrect. This file was taken from a c program that I wrote several years ago on an older OS and an older version of Pelles C and I don't recall it having any problems then. I'll have to make sure that I use the correct encoding in future and convert my older resource files accordingly.

EDIT: I've just discovered that some of the settings for the project options in the IDE were set to UTF-16LE and this could be why the resource file used an invalid coding. I've changed these to UTF-8 and this seems to have helped with a new project.



Title: Re: Strange problem with the IDE
Post by: frankie on July 03, 2023, 06:48:59 PM
I've just discovered that some of the settings for the project options in the IDE were set to UTF-16LE and this could be why the resource file used an invalid coding. I've changed these to UTF-8 and this seems to have helped with a new project.
This shouldn't cause a problem, moreover you said that it worked for the first compile.  ???
Maybe this is a bug...  :P
Title: Re: Strange problem with the IDE
Post by: Robert on July 03, 2023, 07:34:22 PM
I've just discovered that some of the settings for the project options in the IDE were set to UTF-16LE and this could be why the resource file used an invalid coding. I've changed these to UTF-8 and this seems to have helped with a new project.
This shouldn't cause a problem, moreover you said that it worked for the first compile.  ???
Maybe this is a bug...  :P

I just loaded the \Samples\Add-Ins\BuildVer project into Pelles C 12.00.2 on Windows 11, converted the buildver.rc file from UTF-8 with a BOM to UTF-16LE with a BOM and the IDE crashed on Build ReBuild or Clean.

Bug ? Yes. Pelles C or Windows 11 ? My guess is Windows 11 because frankie said no problem with Windows 10.

Title: Re: Strange problem with the IDE
Post by: frankie on July 03, 2023, 09:10:30 PM
I just loaded the \Samples\Add-Ins\BuildVer project into Pelles C 12.00.2 on Windows 11, converted the buildver.rc file from UTF-8 with a BOM to UTF-16LE with a BOM and the IDE crashed on Build ReBuild or Clean.

Bug ? Yes. Pelles C or Windows 11 ? My guess is Windows 11 because frankie said no problem with Windows 10.
Robert I made same checks under WIN10, the problem seems not be present.
Where is the bug, at this point, depends on what Pelle use to open files and handle encoding. If that is done using WINAPI functions the problem is WIN11, if the encoding is handled by Pelle's functions the IDE is buggy (or not WIN11 compliant)...  :P
Title: Re: Strange problem with the IDE
Post by: Robert on July 03, 2023, 10:34:29 PM
I just loaded the \Samples\Add-Ins\BuildVer project into Pelles C 12.00.2 on Windows 11, converted the buildver.rc file from UTF-8 with a BOM to UTF-16LE with a BOM and the IDE crashed on Build ReBuild or Clean.

Bug ? Yes. Pelles C or Windows 11 ? My guess is Windows 11 because frankie said no problem with Windows 10.
Robert I made same checks under WIN10, the problem seems not be present.
Where is the bug, at this point, depends on what Pelle use to open files and handle encoding. If that is done using WINAPI functions the problem is WIN11, if the encoding is handled by Pelle's functions the IDE is buggy (or not WIN11 compliant)...  :P

Aha, another twist in the plot. If Pelle changed the opening/encoding between 11 and 12 then it should be easy to figure out. If not, well, you can imagine ???
Title: Re: Strange problem with the IDE
Post by: John Z on July 03, 2023, 10:58:35 PM
Has anyone already compared the .tag, .ppx and maybe also the .ppj files created from the first run (which works without source code mods) to a working run which has the needed UTF change to see what is different?  Since deleting the two files allows it to work again I suspect there maybe clues within the them?

John Z
Title: Re: Strange problem with the IDE
Post by: TimoVJL on July 04, 2023, 04:48:02 AM
Removing some Add-Ins could test too.
Title: Re: Strange problem with the IDE
Post by: Robert on July 04, 2023, 10:08:37 AM
I've just discovered that some of the settings for the project options in the IDE were set to UTF-16LE and this could be why the resource file used an invalid coding. I've changed these to UTF-8 and this seems to have helped with a new project.
This shouldn't cause a problem, moreover you said that it worked for the first compile.  ???
Maybe this is a bug...  :P

I just loaded the \Samples\Add-Ins\BuildVer project into Pelles C 12.00.2 on Windows 11, converted the buildver.rc file from UTF-8 with a BOM to UTF-16LE with a BOM and the IDE crashed on Build ReBuild or Clean.

Bug ? Yes. Pelles C or Windows 11 ? My guess is Windows 11 because frankie said no problem with Windows 10.

I have just finished loading a fresh install of Windows 10 on my old machine.

As above, I loaded the \Samples\Add-Ins\BuildVer project into Pelles C 12.00.2 on Windows 10, converted the buildver.rc file from UTF-8 with a BOM to UTF-16LE with a BOM and the IDE crashed on Build ReBuild or Clean.

frankie and I have had different results. He says O.K. I say not O.K.

What I have learned and intend to do is not use UTF-16LE with a BOM with Pelles C 12.00.2.

Tomorrow I am going to run the same tests with Pelles C 11.

Trust but verify !

Title: Re: Strange problem with the IDE
Post by: frankie on July 04, 2023, 03:00:36 PM
Today I loaded the \Samples\Add-Ins\BuildVer project into Pelles C 12.00.2 on my office Windows 10 machine, and after I converted the buildver.rc file from UTF-8 with a BOM to UTF-16LE with a BOM the IDE crashed on Build ReBuild or Clean.
I don't have still clear why my home machine worked...  :(
I'll do more tests tonight.
For now I can confirm that at least on this machine PellesC IDE V12.02 fails when the rc file is encoded as 16BLE. :P

P.S. I can also confirm that with PellesC IDE V11 it works with no problems with both the encodings.
Title: Re: Strange problem with the IDE
Post by: frankie on July 05, 2023, 09:36:35 AM
I have checked again with my home computers, WIN10 and PellesC 12.02, and it works...  :o :(
I have also reinstalled PellesC to be sure to have the last version running, but it works anyway.
I can't understand what are the differences between the machines...  ??? ???
Surely there is a relation between the IDE and some configuration.
This weekend I'll investigate more...


Found!  8)
The problem, at least in my case, is the addin "trimtail.dll", "Trim whitespaces at end of line".
Disabling it anything works!  8)

At this point I will re-ask to Pelle to remove the automatic enabling of all addins that could be very very very very dangerous.
Please everybody: Check the addins that are actually enabled and remove those unuseful.
Title: Re: Strange problem with the IDE
Post by: Robert on July 05, 2023, 05:45:05 PM
Fantastic frankie ! Thank you.

Also kudos to the super prescient TimoVJL for his tip.
Title: Re: Strange problem with the IDE
Post by: CProgrammer on July 05, 2023, 05:50:15 PM
Thank you for all these replies.

Good to know that the issue was with an addin.
Title: Re: Strange problem with the IDE
Post by: John Z on July 06, 2023, 02:38:59 AM
Great find Frankie!, excellent input by TimoVJL.  You two are tops!


John Z

P.S. The dll may just need to be recompiled under Version 12 to work fine.  I had to to this with one of my own, when version 11 came out.  No code change just recreate the dll.
Title: Re: Strange problem with the IDE
Post by: frankie on July 06, 2023, 01:55:49 PM
The dll may just need to be recompiled under Version 12 to work fine.  I had to to this with one of my own, when version 11 came out.  No code change just recreate the dll.
Confirmed.

But I found the real problem at the end  >:(
The culprit in the original post is the "buildver.dll", "increment build number" addin. It generates the temporary files hanging up through the resource file scanning when it runs.
Can't fix it, need in-deep debug.  :P
Title: Re: Strange problem with the IDE
Post by: frankie on July 08, 2023, 01:33:18 AM
I fixed the buildver.dll.  8)
Can download it here (https://forum.pellesc.de/index.php?topic=10932.msg37834#msg37834).