Recent

Author Topic: Error building fpGUI  (Read 2139 times)

jules.d

  • Newbie
  • Posts: 3
Error building fpGUI
« on: August 07, 2022, 05:33:06 pm »
Hi, I'm new to freepascal although I did program in TP back in the 90s. I'm using Linux 64 (a Debian bullseye based distro), and am gettting an error message when compiling fpGUI 1.4.1 downloaded from sourceforge.

I've installed the prerequisites as per the readme, and this is what I get when running the build script :

Compiling X11 CoreLib
Free Pascal Compiler version 3.2.2+dfsg-9~bpo11+1 [2022/02/21] for x86_64
Copyright (c) 1993-2021 by Florian Klaempfl and others
Target OS: Linux for x86-64
Compiling corelib/x11/fpgui_toolkit.pas
Compiling ./corelib/fpg_base.pas
Compiling corelib/x11/fpg_x11.pas
fpg_x11.pas(730,25) Hint: Local variable "AtomPair" does not seem to be initialized
fpg_x11.pas(1042,18) Hint: Local variable "msgp" does not seem to be initialized
fpg_x11.pas(1069,18) Error: Can't determine which overloaded function to call
math.pp(2075,10) Hint: Found declaration: Min(QWord;QWord):QWord;
math.pp(2059,10) Hint: Found declaration: Min(Int64;Int64):Int64;
fpg_x11.pas(1233,24) Hint: Local variable "msgp" does not seem to be initialized
fpg_x11.pas(1253,14) Note: User defined: We need to replace this message with a resouce string
fpg_x11.pas(1292,15) Hint: Local variable "Msg" does not seem to be initialized
fpg_x11.pas(1329,15) Hint: Local variable "Msg" does not seem to be initialized
fpg_x11.pas(1562,39) Hint: Local variable "rw" does not seem to be initialized
fpg_x11.pas(1635,16) Hint: Local variable "s" of a managed type does not seem to be initialized
fpg_x11.pas(1705,16) Hint: Local variable "msgp" does not seem to be initialized
fpg_x11.pas(2323,20) Hint: Local variable "ar1" of a managed type does not seem to be initialized
fpg_x11.pas(2334,18) Hint: Local variable "ar2" of a managed type does not seem to be initialized
fpg_x11.pas(2366,25) Warning: Symbol "RootWindow" is not portable
fpg_x11.pas(2368,16) Hint: Local variable "attr" does not seem to be initialized
fpg_x11.pas(2445,17) Hint: Local variable "hints" does not seem to be initialized
fpg_x11.pas(2842,87) Hint: Local variable "extents" does not seem to be initialized
fpg_x11.pas(2857,87) Hint: Local variable "extents" does not seem to be initialized
fpg_x11.pas(3561,20) Warning: Symbol "RootWindow" is not portable
fpg_x11.pas(3614,33) Hint: Local variable "info" does not seem to be initialized
fpg_x11.pas(3842,17) Hint: Local variable "xev" does not seem to be initialized
fpg_x11.pas(3996,14) Hint: Local variable "ev" does not seem to be initialized
fpg_x11.pas(4046) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode

Any help appreciated.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Error building fpGUI
« Reply #1 on: August 07, 2022, 05:57:26 pm »
Welcome to the forum :-)

I can't help directly, but to get the ball rolling I think the pertinent points are that you've got fpGUI 1.4.1 plus FPC 3.2.2 hence

Code: [Select]
fpg_x11.pas(1069,18) Error: Can't determine which overloaded function to call
math.pp(2075,10) Hint: Found declaration: Min(QWord;QWord):QWord;
math.pp(2059,10) Hint: Found declaration: Min(Int64;Int64):Int64;

Sourceforge puts a date of 2015-09-02 on fpGUI 1.4.1, which was I think was in the reign of FPC 2.6. So what's probably happened is that Min() has gained an overloaded function since then, i.e. originally it only supported 64-bit signed integers and it has since gained 64-bit unsigned (or vice versa).

If nobody else crops up before your patience starts fraying, take a look at the source line with the error and try to work out whether to cast the parameters using either QWord() or Int64(). Otherwise, if you're really hard up, it might be worth downgrading the compiler to 2.6.4... but I'd really not recommend that.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

sketch

  • New Member
  • *
  • Posts: 32
Re: Error building fpGUI
« Reply #2 on: August 07, 2022, 06:10:53 pm »
I'm running Ubuntu 22.04 LTS and fpc 3.2.2.  I get the same error using 1.4.1 from Sourceforge, but this worked:

 678  git clone https://github.com/graemeg/fpGUI.git
 679  sudo apt-get install fp-units-i386
 680  sudo apt-get install libx11-dev
 681  sudo apt-get install libxft-dev
 682  cd fpGUI/
 686  cd src/
 687  ./build.sh

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Error building fpGUI
« Reply #3 on: August 07, 2022, 06:42:13 pm »
Yes, that's probably the way to go. I'd forgotten that the author had gittish tendencies... but in any event I think it's fair to criticise him for not documenting the expected compiler version in the release notes, and for leaving an outdated version on SF without warning.

I'd note that a lot of people are wary of the FPC release from Debian, and instead prefer to use Debian to provide the prerequisites (build-essential, gdb and so on) and then use the current/stable compiler provided by the FPC project as a tar archive. Same goes for the Lazarus IDE: most people quite simply build from source (and the last I saw Debian actually had a package versioning problem in what they were shipping).

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

jules.d

  • Newbie
  • Posts: 3
Re: Error building fpGUI
« Reply #4 on: August 07, 2022, 08:36:48 pm »
Thanks for the input guys. So I've compiled the libraries and also the corelib and gui programs in the examples folder, but the build failed in the apps folder with the following error message :

Doing docedit in ./docedit
./compileall.sh: 9: cd: can't cd to ./docedit
Fatal: Unable to open file extrafpc.cfg
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode
Doing hexview in ./hexviewer
Fatal: Unable to open file extrafpc.cfg
Fatal: Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode


How do I build the uidesigner? I assume this is a kind of visual designer which lets you drag and drop gui elements, like lazarus. The documentation is pretty sketchy. There's a tutorial in docs/quick_guide but the file has a strange extension (.ipf) and it's not easy to read.

I notice that some of the files in the uidesigner folder have .lpi and .lpr extensions. Does this mean that I need lazarus to compile it?

Like I said, I'm new to Free pascal and the last time I did any programming was in 1998, in Turbo pascal, so I'm probably getting ahead of myself, although I've written a few terminal programs in the last few days and looked at the documentation, which I'm finding a bit overwhelming.

Sorry to be so clueless.  :-[

« Last Edit: August 07, 2022, 08:44:52 pm by jules.d »

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: Error building fpGUI
« Reply #5 on: August 07, 2022, 09:43:38 pm »
Thanks for the input guys. So I've compiled the libraries and also the corelib and gui programs in the examples folder, but the build failed in the apps folder with the following error message :
Doing docedit in ./docedit
./compileall.sh: 9: cd: can't cd to ./docedit

Indeed, I just try it and script fails trying to enter /docedit directory.  %)
Very strange, so I did Cut that directory and then all other examples compile ok.
Dont forget to add the /fpGUI/src/extrafpc.cfg file into /fpGUI/examples/apps/

How do I build the uidesigner?

Code: Pascal  [Select][+][-]
  1. > cd /directory_of/fpGUI/uidesigner
  2.  
  3. > fpc @extrafpc.cfg uidesigner.lpr

You may also use the "extended" version of fpGUI designer.
https://github.com/fredvs/uidesigner_ext/releases

I notice that some of the files in the uidesigner folder have .lpi and .lpr extensions. Does this mean that I need lazarus to compile it?

No, you dont need Lazarus to compile fpGUI projects but using a IDE like Lazarus (and his lpi file) will be a great help for debugging.

(You may also use the ṕrj files with the IDE MSEide or ideU).

Fre;D
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Error building fpGUI
« Reply #6 on: August 07, 2022, 09:54:33 pm »
Doing docedit in ./docedit
./compileall.sh: 9: cd: can't cd to ./docedit
...
Doing hexview in ./hexviewer

Do those directories already exist anywhere? It might be that you need to create them manually, or that you're starting off in the wrong directory ("you won't get there from here").

Quote
How do I build the uidesigner? I assume this is a kind of visual designer which lets you drag and drop gui elements, like lazarus. The documentation is pretty sketchy. There's a tutorial in docs/quick_guide but the file has a strange extension (.ipf) and it's not easy to read.

I notice that some of the files in the uidesigner folder have .lpi and .lpr extensions. Does this mean that I need lazarus to compile it?

.ipf: I've got a sketchy recollection that Graeme was an OS/2 fan, and that's an OS/2 helpfile format.

You're correct in associating .lpi with Lazarus: that's a Project Information file and either the Lazarus IDE or the lazbuild program should be able to handle it...

Quote
Like I said, I'm new to Free pascal and the last time I did any programming was in 1998, in Turbo pascal, so I'm probably getting ahead of myself, although I've written a few terminal programs in the last few days and looked at the documentation, which I'm finding a bit overwhelming.

Sorry to be so clueless.  :-[

...however, allowing for how much grief that stuff is giving you you might be better off starting off with Lazarus, which (I can assure you) is a fairly decent IDE.

I think you said you'd already got FPC 3.2.2, in which case I suggest you build Lazarus from source using e.g. https://sourceforge.net/projects/lazarus/files/latest/download : there's known issues with some distreaux's packaging.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Error building fpGUI
« Reply #7 on: August 07, 2022, 09:56:17 pm »
Indeed, I just try it and script fails trying to enter /docedit directory.  %)

Fred, I suggest you either bring the SF repo up to date, or tell people where to get the live version.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: Error building fpGUI
« Reply #8 on: August 07, 2022, 10:10:55 pm »
Indeed, I just try it and script fails trying to enter /docedit directory.  %)

Fred, I suggest you either bring the SF repo up to date, or tell people where to get the live version.

MarkMLl

Hello Mark.

I am not maintainer of fpGUI and Graeme seems very busy, many pull-request are waiting on fpGUI-GitHub...

 :-[

I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Error building fpGUI
« Reply #9 on: August 07, 2022, 10:18:59 pm »
I am not maintainer of fpGUI and Graeme seems very busy, many pull-request are waiting on fpGUI-GitHub...

In that case I suggest keeping your head /well/ below the parapet.

Seems like a case of githubris to me...

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

Fred vS

  • Hero Member
  • *****
  • Posts: 3158
    • StrumPract is the musicians best friend
Re: Error building fpGUI
« Reply #10 on: August 07, 2022, 10:25:41 pm »
I hope all is OK with Graeme.

His last commit was in April of last year.
https://github.com/graemeg/fpGUI/commits/develop
I use Lazarus 2.2.0 32/64 and FPC 3.2.2 32/64 on Debian 11 64 bit, Windows 10, Windows 7 32/64, Windows XP 32,  FreeBSD 64.
Widgetset: fpGUI, MSEgui, Win32, GTK2, Qt.

https://github.com/fredvs
https://gitlab.com/fredvs
https://codeberg.org/fredvs

MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Error building fpGUI
« Reply #11 on: August 07, 2022, 10:34:28 pm »
I hope all is OK with Graeme.

His last commit was in April of last year.
https://github.com/graemeg/fpGUI/commits/develop

:-( As do we all. But at this point- getting on for 18 months in- I think we need to start thinking about remedial action to avoid the overall community looking bad: at the very least the repo pointed to by https://en.wikipedia.org/wiki/FpGUI needs to be fixed. Does the FPC website itself have any links to the old SF stuff?

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

jules.d

  • Newbie
  • Posts: 3
Re: Error building fpGUI
« Reply #12 on: August 08, 2022, 09:36:54 am »
Thanks again Fred & Mark for the advice. I got fpGUI working with the uidesigner but I think you're right in that I'll find Lazarus easier to begin with. I never learned OOP with Turbo  pascal so I have some studying to do before I understand classes etc, which I need to know in order to use fpGUI. At least in Lazarus you're shielded from that to a certain extent and can create software without knowing much about what goes on under the hood.

By the way, there is a link to the fpGUI github site under the "General" tab, but it's not at all clear that you should download from there rather than sourceforge.

I tried installing the qt version (I'm using KDE plasma) of Lazarus using apt but got errors when compiling a simple GUI application, so I guess you're right about issues with packaging.

Quote
I think you said you'd already got FPC 3.2.2, in which case I suggest you build Lazarus from source using e.g. https://sourceforge.net/projects/lazarus/files/latest/download : there's known issues with some distreaux's packaging.

So that deb file is the lazarus source, correct? How can I compile the qt version?


MarkMLl

  • Hero Member
  • *****
  • Posts: 6676
Re: Error building fpGUI
« Reply #13 on: August 08, 2022, 10:00:04 am »
I'd suggest uninstalling (from the Debian POV) the Lazarus you got via apt or whatever.

You will however need the libqt5pas1 package or similar depending on your Debian version.

Code: Text  [Select][+][-]
  1. $ apt-cache search -n libqt | grep pas
  2. libqt5pas-dev - Development files for Qt5Pas
  3. libqt5pas1 - Qt5 interface bindings for Pascal
  4. libqt5keychain1 - Qt API to store passwords (QT5 version)
  5.  

Download https://sourceforge.net/projects/lazarus/files/Lazarus%20Zip%20_%20GZip/ and put it into somewhere suitable (I'm not sure how orthodox this is, but I usually have a user-writable directory e.g. /usr/local/share/lazarus-stable and then set up symlinks to the binaries in /usr/local/bin).

If getting to grips with it for the first time or on a new system, I suggest a sequence like this, making sure that each step completes

Code: [Select]
make all
make clean
make bigide
make clean
make LCL_PLATFORM=qt bigide

"all" will give you the basic IDE and LCL. "bigide" will do the same but add on more components etc. The final step will do the same but for Qt.

YMMV, but that's what works for me.

I'd add that I really don't know what compelling advantage FPGui has over the LCL, other than that it's arguably lighter-weight.

It has however always struck me as unfortunate that Linux didn't have a text-mode UI builder using Curses etc., i.e. something like MS Visual Basic for DOS, or like the better "4GLs" that were popular in the '90s.

Having a proper form editor, plus database support etc., which /didn't/ demand fancy graphical output, really could have been the killer app that Linux (and FPC) needed.

The industry didn't go that way, and now we've got an enormously complex stack of compositor, server, widget set...

MarkMLl
« Last Edit: August 08, 2022, 11:48:37 am by MarkMLl »
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

toby

  • Sr. Member
  • ****
  • Posts: 251
Re: Error building fpGUI
« Reply #14 on: December 29, 2022, 12:29:57 am »
12/28/22

Hi,

i am using fpgfilesize function in my code which is in the fpgui unit so i got the exact same error when i recompiled my program on a 64bit linux system using fpc-3.2.2 (i had originally used fpc-3.1.1 (i think) on a 32bit linux system with fpgui-1.4.1 for previously working compile)

on 64bit linux using fpc-3.2.2 with fpgui-1.4.1 i got
fpg_x11.pas(1099,18) Error: Can't determine which overloaded function to call
math.pp(2075,10) Hint: Found declaration: Min(QWord;QWord):QWord;
math.pp(2059,10) Hint: Found declaration: Min(Int64;Int64):Int64;

-

i didn't see an fpgui update as a solution now (since fpgui version is now 1.5 in the develop.zip)

dillo https://github.com/graemeg/fpGUI/archive/refs/heads/develop.zip

-

specifically this is what i did to get my fpgfilesize/fpgui/fpg_x11.pas to compile

unzip develop.zip

ls fpGUI-develop/src
3rdparty   buildcrosslinux32.sh  build.sh         corelib       fpmake.pp  gui           VERSION_FILE.inc
build.bat  buildcrosswin32.sh    build_wince.bat  extrafpc.cfg  fpreport   reportengine

mv /usr/local/fpc/units/fpgui /usr/local/fpc/units/fpgui-1.4.1
mkdir /usr/local/fpc/units/fpgui
cp fpGUI-develop/src/corelib /usr/local/fpc/units/fpgui
cp fpGUI-develop/src/gui /usr/local/fpc/units/fpgui

i didn't want to change my /etc/fpc.cfg for -Fi for the following .inc so i did
cp fpGUI-develop/src/corelib/fpg_defines.inc /usr/local/fpc/units/fpgui/corelib/x11/fpg_defines.inc
cp fpGUI-develop/src/VERSION_FILE.inc /usr/local/fpc/units/fpgui/corelib/x11/VERSION_FILE.inc
cp fpGUI-develop/src/3rdparty/regex/synregexpr.pas /usr/local/fpc/units/fpgui/corelib/x11/synregexpr.pas

---

 

TinyPortal © 2005-2018