fpGUI icon indicating copy to clipboard operation
fpGUI copied to clipboard

fpGUI or docView still crash or freezing (LZ 4.4 WIN 11)

Open ChrigiGee opened this issue 2 months ago • 92 comments

Hi there,

Science longer, no change on Windows 11 with fpGUI or better docView. On my system still freezing.

Win 11 Lenovo Notebook Lazarus the past 3 or 4 Edition backward from 4.4

I try with the release on gh and with the dev. Branch. If I install by Lazarus the Packages from fpGUI, Lazarus wrote Error with not exist "laz.virtualtrees.pas" by re-compiling Lazarus.

I can't find out what happen, from Lazarus or fpGUI.

Someone has an Idea ?

Kind regards Chris

ChrigiGee avatar Nov 21 '25 18:11 ChrigiGee

Hi. Thanks for reporting. I don't have Win11, but I'll retest with the Windows VMs I do have. Let me have a quick look with the latest develop branch and FPC 3.2.2. 🤞

graemeg avatar Nov 21 '25 18:11 graemeg

Bloody hell, now I remember why I stopped using Windows some 15+ years ago. Halfway through installing FPC 3.2.2 on a Windows 10 VM, Windows forcefully decides to reboot for an update. WTF. It didn't even warning me or anything, or give me any choice in the matter. 😠

graemeg avatar Nov 21 '25 18:11 graemeg

Hi Graemeg,

don't worry about, .... I was thinking to tell you all, something really wrong with the Win Edition. But after a long time to testing what happened, I can't solve the Problem on my side.

Win is a bigger trash System science long time. But 99% of the worldwide systems for customers are still Windows, I think.

Kind regards from Switzerland Chris

Bloody hell, now I remember why I stopped using Windows some 15+ years ago. Halfway through installing FPC 3.2.2 on a Windows 10 VM, Windows forcefully decides to reboot for an update. WTF. It didn't even warning me or anything, or give me any choice in the matter. 😠

ChrigiGee avatar Nov 22 '25 08:11 ChrigiGee

No, no, it's fine, I got my Windows VM working again, and managed to compile and run a few apps, but it was using the 32-bit FPC compiler. Seems FPC for some reason doesn't have a native 64-bit compiler installer available in this day and age - how weird. I'm in the process of compiling a native 64-bit windows FPC now.

So far 32-bit compilation and apps are working fine here. Can you post the exact error message you see, or a screenshot of the error. Also, I'm assuming you are using 64-bit FPC on Windows? What version of Free Pascal Compiler are you using? 3.2.2?

graemeg avatar Nov 22 '25 11:11 graemeg

Why dont you use the best Windows version: wine on Unix? It can emulate 32/64 bit and each Windows official version.

Image

_

Seems FPC for some reason doesn't have a native 64-bit compiler installer available in this day and age - how weird.

https://github.com/fredvs/freepascal-ootb/releases/

fredvs avatar Nov 22 '25 12:11 fredvs

Nice, thanks Fred for the link to OOTB binaries. Awesome! 👏

As for testing with WINE. As good as WINE is, some software behaves differently. eg: XanaNews nntp news client compiled with Delphi, runs perfectly under any Windows version. Under Wine, it runs, but there are scrollbar and dialog sizing issues under WINE. So I rather opt to have Windows VMs for easy testing. I even share the fpgui repo via VirtualBox's "shared folders", so I don't have to clone repos or anything. This allows me to edit and compile fpgui while in Linux (or FreeBSD), then switch focus to the Windows VM, and immediately recompile there too - as both look at the same code directory. :-)

graemeg avatar Nov 22 '25 15:11 graemeg

Hello Graeme and thanks for the thanks!

Regarding Wine, it's clear that a Windows machine is preferable for testing, but I share your concern: booting into Windows scares me. How many updates will it perform, and for how long?

For my applications, I develop under Linux, and for the Windows binary, I use: wine fpc.exe myapp.pas

which I then launch with wine myapp.exe.

If everything seems to be working correctly, for the release, I switch to a Windows operating system, making sure beforehand that I have plenty of time and patience. I verify that everything is in order, then I recompile the source code to obtain the Windows binary.

That said, you solution to use a VM Windows is great (but I was not able to install Windows 11 on Linux Virtual-Box).

fredvs avatar Nov 22 '25 16:11 fredvs

Yeah, Windows has really gone down the crapper. 😞 I have 3 windows VMs. Win2000 (my favourite, but now very old), Windows 7 64-bit and Windows 10 64bit (brand new, still need to configure it, but that's the one that rebooted while I was installing FPC 🙄 ).

Anyway, my Windows 7 vm seems to be doing the trick for now. I just need to get a 64-bit FPC 3.2.2 and newer installed there too.

graemeg avatar Nov 22 '25 16:11 graemeg

Hello Graeme and Fred,

I was worried I'd look like a fool since my fpGUI and docView weren't working despite dozens of compilation attempts.

Or rather, I was worried about installing the additional packages for fpGUI, or in my case, not being able to install them correctly.

I really hope I'm not causing you any extra work, because I love Graeme's work with fpGUI.

Best regards, Chris

ChrigiGee avatar Nov 22 '25 16:11 ChrigiGee

Hi Chris, it would be super helpful if you can post the exact error you are seeing. Also FPC version, 32-bit or 64-bit and do you have AggPas (Agg-based canvas enabled or not). This info is vital in helping me find the cause of your problems.

And no worries, I have to get this fixed, whatever the cause is. :-)

graemeg avatar Nov 22 '25 17:11 graemeg

Hi Graemeg,

I try to compile docView, don't work with standard Lazarus.

All prior Packages to install, I have some different Error for other Packages.

First to install fpgui_ide Package, but by installing and recompiling Lazarus crash. Lazarus missing laz.virtualtrees.pas Error Message by the ScreenShot.

I install step by step all new Package same problem missing virtualtreeview, possible to install all Packages but not re-compiling lazarus.

Delete first fpgui_ide I have to test it now. But I think again, same problem. Beginning with fpgui_ide from the new gh repo beginning with problem by lazarus. So I have to re-install lazarus.

Tomorrow I will check about Package virtualtreeview and the new fpgui_ide. Deinstall fpgui_ide 0.2 from lazarus and insstall new one and install again virtualtreeview Package.

Kind regards. Chris

Image

ChrigiGee avatar Nov 22 '25 21:11 ChrigiGee

Hello Chris. I'm not an expert in Lazarus but your error seems to come from a lack of permissions when trying to rebuild Lazarus.

Have you tried "Run as administrator" (right click on the Lazarus exe or shortcut and select it), then try again to install the package + recompilation of Lazarus.

For an fpGUI compatible IDE, there is also ideU.

fredvs avatar Nov 22 '25 22:11 fredvs

@graemeg : I did try to compile DocView from develop branch on Linux 64 bit with fpc 3.2.2. but get error:

frm_main.pas(3965,15) Error: range check error while evaluating constants (55217 must be between 0 and 255)

Image

PS: the docview.prj was not out-of-the-box, if you want I can give one easier. ;-)

fredvs avatar Nov 22 '25 23:11 fredvs

Oops, I tried after the new docview_clean.prj created and it works and DocView is still great!

Computers are really strange animals…

Sorry about the noise.

Image

fredvs avatar Nov 23 '25 00:11 fredvs

For (relative) fun, I tested it on a real Windows 11 machine. After a few reboot needed for the updates, I tried compiling DocView with the latest version of Lazarus.

Running it as administrator, I was able to install the fpgui_ide package and recompile Lazarus.

But… after restarting Lazarus and trying to compile docview.lpi, I get again the error "Missing package fpgui_ide".

So I reinstalled the package, but the "Missing package fpgui_ide" error persists.

After many attempts, I gave up.

I had more luck with ideU and docview_clean.prj (a few adapted for windows here in zip). docview_clean.prj.zip

Image

fredvs avatar Nov 23 '25 01:11 fredvs

@ChrigiGee

Compiling a fpGUI program and compiling the fpGUI package for Lazarus are two different things.

You don't need to install any package to build a fpGUI program with Lazarus.

For me, I never used the fpGUI package, and never saw its utility. I would suggest not to use it.

Best regards.

Roland

rchastain2 avatar Nov 23 '25 06:11 rchastain2

Here is for example a Windows script that I use for compiling a fpGUI program under Windows:

fpc -Mobjfpc -Sh %1 -Fu%~d0\sources\fpgui\lib\i386-win32

(I use it on a USB key, hence the %~d0. You can provide a drive letter instead.)

I named it build.cmd and call it like this (from the command prompt):

build myprogram.lpr

Of course, you have to provide the path to your fpGUI compiled units. For a 64-bit compilation, the folder is <FPGUI>\lib\x86_64-win64.

You have to compile fpGUI first, using the script <FPGUI>\src\build.bat.

P.-S. In the folder of my fpGUI program, I have another script named console.cmd, that allowes me to open easily a command prompt:

@%COMSPEC%

rchastain2 avatar Nov 23 '25 07:11 rchastain2

I am confused about this 'fpgui_ide' package? I have no idea what that is, and it's not something from the fpGUI project. So maybe speak to Lazarus support about that.

fpGUI include two Lazarus packages (for convenience only), and neither of them needs to be installed in Lazarus, simply opened, so the Lazarus IDE knows where they are located.

Open the 'fpgui_toolkit.lpk' found in src/corelib/gdi/ directory. Then open the docview.lpi project. Now compile the project. That should be it.

Again, nothing needs to be installed in Lazarus IDE, and lazarus itself doesn't need to be recompiled. fpGUI doesn't depend on Lazarus at all.

graemeg avatar Nov 23 '25 09:11 graemeg

Hi @fredvs,

oh my gosh, right, I don't use in Admin mode. I try in Admin Mode again, and I UpDate you all how it's works. I was so confused what wrong, because all the time before, it's work and I think, I always run Lazarus in admin Mode before, and now no more.

Kind regards Chris

Hello Chris. I'm not an expert in Lazarus but your error seems to come from a lack of permissions when trying to rebuild Lazarus.

Have you tried "Run as administrator" (right click on the Lazarus exe or shortcut and select it), then try again to install the package + recompilation of Lazarus.

For an fpGUI compatible IDE, there is also ideU.

ChrigiGee avatar Nov 23 '25 09:11 ChrigiGee

Hi @fredvs,

I was really wondering, too. DocView Project doesn't work like your Vote. DocView_Clean Project work like your UpDate at my System too.

Only from the DIR "GDI" I have to copy all Files to the Root of Corelib.

After some steps it works if someone don't know the ideU he had a lot of work. To understand, a little bit difficult with the structure of ideU and mseide, but helpful for later work faster.

This only for primary workaround I think.

Kind regards Chris

Oops, I tried after the new docview_clean.prj created and it works and DocView is still great!

Computers are really strange animals…

Sorry about the noise. Image

ChrigiGee avatar Nov 23 '25 11:11 ChrigiGee

Hi @rchastain2,

the first work with fpGUI worked to Install the Packages to Lazarus without problems. The DocView was originally in the same DIR as Lazarus and the fpGUI Packages.

So I update with Graeme work, always again to use the newest Edition. I never mind not to use coz Lazars had a fpGUI Edition as System Source, until now only 0.2 of fpGUI.

Sometimes I try with the shell to compiling, but I was no longer lucky after the Problems with freezing GUI from fpGUI and DocView under Windows.

And so I try different way how it's work.

Kind regards Chris

@ChrigiGee

Compiling a fpGUI program and compiling the fpGUI package for Lazarus are two different things.

You don't need to install any package to build a fpGUI program with Lazarus.

For me, I never used the fpGUI package, and never saw its utility. I would suggest not to use it.

Best regards.

Roland

ChrigiGee avatar Nov 23 '25 11:11 ChrigiGee

I am confused about this 'fpgui_ide' package?

fpGUI-develop/extras/lazarus_ide/fpgui_ide.lpk

fredvs avatar Nov 23 '25 12:11 fredvs

Yes, right, if install in Lazarus I had troubles with the la_virtualtrees.pas, he not found anymore, if I'm not wrong just now.

Kind regards Chris

I am confused about this 'fpgui_ide' package?

fpGUI-develop/extras/lazarus_ide/fpgui_ide.lpk

ChrigiGee avatar Nov 23 '25 14:11 ChrigiGee

Hi @fredvs,

little update, you try to rename docvoew_clean.exe to docview.exe ? I copy originally, docview_clean.exe to a new DIR, run OK. I rename same EXE to docview.exe freeze again.

Now I'm confused about, only rename the exe the GUI freezing. docview_clean_1.exe run ok. docview_.exe run ok, please view, end of the name on _ and works.

Compiled with the ideU as docview_clean project. I try now to rename the Project docview_clean to docview and try to compile again.

Rename project docview.prj and compiling freezing of docview.exe.

Rename docview.exe to docview_.exe run ok

Close ideU and open again and compiling project Test..... Freezing if the name is docview.exe

test ideU and compiled with different project name and EXE rename, or else docview.prj and compiled, EXE freezing as docview.exe, always

Rename to any other name of the EXE, work fine.

Kind regards Chris

PS: ideU run always as Admin Mode....

For (relative) fun, I tested it on a real Windows 11 machine. After a few reboot needed for the updates, I tried compiling DocView with the latest version of Lazarus.

Running it as administrator, I was able to install the fpgui_ide package and recompile Lazarus.

But… after restarting Lazarus and trying to compile docview.lpi, I get again the error "Missing package fpgui_ide".

So I reinstalled the package, but the "Missing package fpgui_ide" error persists.

After many attempts, I gave up.

I had more luck with ideU and docview_clean.prj (a few adapted for windows here in zip). docview_clean.prj.zip Image

ChrigiGee avatar Nov 23 '25 14:11 ChrigiGee

Hi @graemeg ,

Windows, with the NEW fpGUI and DocView, Lazarus can't compile. Still on Windows is fpGUI 0.2 version.

Any work to install fpGUI actually Version and Lazarus crash so reinstall.

Until now, I don't know where is it the Problem.

With ideU compiling docview work but not with Filename docview.exe, freezing again like usual.

I'm not sure Windows 11 or something in the Source with Windows 11 not work fine. Runs in ideU the docview project freeze of docview.exe too with Error Message path to Help File not found. ONLY ideU given me an Error like this to not found Path.

Kind regards Chris

I am confused about this 'fpgui_ide' package? I have no idea what that is, and it's not something from the fpGUI project. So maybe speak to Lazarus support about that.

fpGUI include two Lazarus packages (for convenience only), and neither of them needs to be installed in Lazarus, simply opened, so the Lazarus IDE knows where they are located.

Open the 'fpgui_toolkit.lpk' found in src/corelib/gdi/ directory. Then open the docview.lpi project. Now compile the project. That should be it.

Again, nothing needs to be installed in Lazarus IDE, and lazarus itself doesn't need to be recompiled. fpGUI doesn't depend on Lazarus at all.

ChrigiGee avatar Nov 23 '25 14:11 ChrigiGee

Hi @fredvs, little update, you try to rename docvoew_clean.exe to docview.exe ? I copy originally, docview_clean.exe to a new DIR, run OK. I rename same EXE to docview.exe freeze again.

Hi Chris.

Ha, so I am not the only one to have a strange computer! (see my previous post):

@graemeg : I did try to compile DocView from develop branch on Linux 64 bit with fpc 3.2.2. but get error: frm_main.pas(3965,15) Error: range check error while evaluating constants (55217 must be between 0 and 255).

And the post that follows:

Oops, I tried after the new docview_clean.prj created and it works and DocView is still great! Computers are really strange animals…

So this is the strange story on my Linux machine:

. Using docview.prj = compilation fails with range error. . Using docview_clean.prj = compilation OK and run OK. . Rename binary docview_clean into docview = run crash. . Rename docview_clean.prj in docview.prj = compilation fails.

This is really very strange. Sorry but I dont see explanation at the moment.

[EDIT] Ooops, no here on Linux rename binary docview_clean into docview = run ok. Only problem with docview.prj.

fredvs avatar Nov 23 '25 15:11 fredvs

@ChrigiGee : I will try again tonight on Windows 11 with both Lazarus and ideU.

fredvs avatar Nov 23 '25 15:11 fredvs

fpGUI-develop/extras/lazarus_ide/fpgui_ide.lpk

Oh wow, I totally forgot that exists. Thanks Fred. That package is so not necessary :-D It just registered a basic template project/file to work with fpGUI. But fpGUI's own UI Designer automatically does the same thing when you go "File -> New Form".

I did double check all the code that is in that fpgui_ide.lpk - there is no reference to virtualtree components, so not sure where that error comes from. 🤔

graemeg avatar Nov 23 '25 16:11 graemeg

Oops, I tried after the new docview_clean.prj created and it works and DocView is still great!

The *_clean.prj files were because MseIde included local session information inside the .prj file. I remember speaking to Martin about that, and he suggested the *_clean idea (and setting the Project -> Options -> Storage to export correctly). I don't know if this is still needed with the latest MseIde - I haven't updated my mseide in a long while (3+ years).

graemeg avatar Nov 23 '25 16:11 graemeg

Using docview.prj = compilation fails with range error.

Probably the -Criot compiler setting is enabled. I'll make sure to fix those errors asap.

graemeg avatar Nov 23 '25 16:11 graemeg