Recent

Author Topic: [SOLVED] QT5 with latest Lazarus has undefined references  (Read 12881 times)

ChrisR

  • Full Member
  • ***
  • Posts: 247
[SOLVED] QT5 with latest Lazarus has undefined references
« on: April 05, 2021, 10:06:55 pm »
I am unalbe to compile event he simplest default project with Lazarus to the Linux QT5 widgetset. This is new, as previously I had no problem, even with complex projects. My libqt5pas seems to be the latest. I am using Ubuntu 20.04



$svn up
Updating '.':
At revision 64929.


$sudo apt install libqt5pas-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libqt5pas-dev is already the newest version (2.8).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

sudo apt install libqt5pas1
Reading package lists... Done
Building dependency tree       
Reading state information... Done
libqt5pas1 is already the newest version (2.8).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.


$lazbuild -B project1.lpr --ws=qt5
TProject.DoLoadStateFile Statefile not found: /home/chris/Downloads/QT5/lib/x86_64-linux/project1.compiled
Hint: (11030) Start of reading config file /home/chris/.fpc.cfg
Hint: (11031) End of reading config file /home/chris/.fpc.cfg
Free Pascal Compiler version 3.2.0 [2020/07/07] for x86_64
Copyright (c) 1993-2020 by Florian Klaempfl and others
(1002) Target OS: Linux for x86-64
(3104) Compiling project1.lpr
(3104) Compiling unit1.pas
(9022) Compiling resource /home/chris/Downloads/QT5/lib/x86_64-linux/project1.or
(9015) Linking /home/chris/Downloads/QT5/project1
/usr/bin/ld: /home/chris/lazarus/lcl/units/x86_64-linux/qt5/qtwidgets.o: in function `QTWIDGETS_$$_QTAXFACTORY$QSTRINGH$QOBJECTH$$QACCESSIBLEINTERFACEH':
qtwidgets.pas:(.text.n_qtwidgets_$$_qtaxfactory$qstringh$qobjecth$$qaccessibleinterfaceh+0xdf): undefined reference to `QLCLAccessibleWidget_Create'
/usr/bin/ld: /home/chris/lazarus/lcl/units/x86_64-linux/qt5/qtwidgets.o: in function `QTWIDGETS$_$TQTACCESSIBLEOBJECT_$__$$_CREATE$TLAZACCESSIBLEOBJECT$QWIDGETH$$TQTACCESSIBLEOBJECT':
qtwidgets.pas:(.text.n_qtwidgets$_$tqtaccessibleobject_$__$$_create$tlazaccessibleobject$qwidgeth$$tqtaccessibleobject+0x14c): undefined reference to `QAccessible_queryAccessibleInterface'
/usr/bin/ld: qtwidgets.pas:(.text.n_qtwidgets$_$tqtaccessibleobject_$__$$_create$tlazaccessibleobject$qwidgeth$$tqtaccessibleobject+0x16a): undefined reference to `QLCLAccessibleWidget_override_child'
/usr/bin/ld: qtwidgets.pas:(.text.n_qtwidgets$_$tqtaccessibleobject_$__$$_create$tlazaccessibleobject$qwidgeth$$tqtaccessibleobject+0x183): undefined reference to `QLCLAccessibleWidget_override_childCount'
/usr/bin/ld: qtwidgets.pas:(.text.n_qtwidgets$_$tqtaccessibleobject_$__$$_create$tlazaccessibleobject$qwidgeth$$tqtaccessibleobject+0x19c): undefined reference to `QLCLAccessibleWidget_override_role'
/usr/bin/ld: qtwidgets.pas:(.text.n_qtwidgets$_$tqtaccessibleobject_$__$$_create$tlazaccessibleobject$qwidgeth$$tqtaccessibleobject+0x1b5): undefined reference to `QLCLAccessibleWidget_override_text'
/usr/bin/ld: /home/chris/lazarus/lcl/units/x86_64-linux/qt5/qtwidgets.o: in function `QTWIDGETS$_$TQTACCESSIBLEOBJECT_$__$$_CHILDOVERRIDE$LONGINT$QACCESSIBLEINTERFACEH':
qtwidgets.pas:(.text.n_qtwidgets$_$tqtaccessibleobject_$__$$_childoverride$longint$qaccessibleinterfaceh+0x73): undefined reference to `QAccessible_queryAccessibleInterface'
/usr/bin/ld: /home/chris/lazarus/lcl/units/x86_64-linux/qt5/qtwidgets.o: in function `QTWIDGETS$_$TQTACCESSIBLETREE_$__$$_CREATE$TLAZACCESSIBLEOBJECT$QWIDGETH$$TQTACCESSIBLETREE':
qtwidgets.pas:(.text.n_qtwidgets$_$tqtaccessibletree_$__$$_create$tlazaccessibleobject$qwidgeth$$tqtaccessibletree+0x9b): undefined reference to `QAccessible_queryAccessibleInterface'
/usr/bin/ld: qtwidgets.pas:(.text.n_qtwidgets$_$tqtaccessibletree_$__$$_create$tlazaccessibleobject$qwidgeth$$tqtaccessibletree+0xb9): undefined reference to `QLCLAccessibleWidget_override_child'
/usr/bin/ld: qtwidgets.pas:(.text.n_qtwidgets$_$tqtaccessibletree_$__$$_create$tlazaccessibleobject$qwidgeth$$tqtaccessibletree+0xd2): undefined reference to `QLCLAccessibleWidget_override_childCount'
/usr/bin/ld: /home/chris/lazarus/lcl/units/x86_64-linux/qt5/qtwidgets.o: in function `QTWIDGETS$_$TQTACCESSIBLETREE_$__$$_CHILDOVERRIDE$LONGINT$QACCESSIBLEINTERFACEH':
qtwidgets.pas:(.text.n_qtwidgets$_$tqtaccessibletree_$__$$_childoverride$longint$qaccessibleinterfaceh+0xc3): undefined reference to `QAccessible_queryAccessibleInterface'
/usr/bin/ld: /home/chris/lazarus/lcl/units/x86_64-linux/qt5/qtwidgets.o: in function `QTWIDGETS$_$TQTACCESSIBLETREEROW_$__$$_CREATE$TLAZACCESSIBLEOBJECT$QWIDGETH$$TQTACCESSIBLETREEROW':
qtwidgets.pas:(.text.n_qtwidgets$_$tqtaccessibletreerow_$__$$_create$tlazaccessibleobject$qwidgeth$$tqtaccessibletreerow+0x9b): undefined reference to `QAccessible_queryAccessibleInterface'
/usr/bin/ld: qtwidgets.pas:(.text.n_qtwidgets$_$tqtaccessibletreerow_$__$$_create$tlazaccessibleobject$qwidgeth$$tqtaccessibletreerow+0xb9): undefined reference to `QLCLAccessibleWidget_override_actionNames'
/usr/bin/ld: qtwidgets.pas:(.text.n_qtwidgets$_$tqtaccessibletreerow_$__$$_create$tlazaccessibleobject$qwidgeth$$tqtaccessibletreerow+0xc7): undefined reference to `QLCLAccessibleWidget_override_child'
/usr/bin/ld: qtwidgets.pas:(.text.n_qtwidgets$_$tqtaccessibletreerow_$__$$_create$tlazaccessibleobject$qwidgeth$$tqtaccessibletreerow+0xd5): undefined reference to `QLCLAccessibleWidget_override_childAt'
/usr/bin/ld: qtwidgets.pas:(.text.n_qtwidgets$_$tqtaccessibletreerow_$__$$_create$tlazaccessibleobject$qwidgeth$$tqtaccessibletreerow+0xee): undefined reference to `QLCLAccessibleWidget_override_childCount'
/usr/bin/ld: qtwidgets.pas:(.text.n_qtwidgets$_$tqtaccessibletreerow_$__$$_create$tlazaccessibleobject$qwidgeth$$tqtaccessibletreerow+0x107): undefined reference to `QLCLAccessibleWidget_override_doAction'
/usr/bin/ld: qtwidgets.pas:(.text.n_qtwidgets$_$tqtaccessibletreerow_$__$$_create$tlazaccessibleobject$qwidgeth$$tqtaccessibletreerow+0x120): undefined reference to `QLCLAccessibleWidget_override_parent'
/usr/bin/ld: qtwidgets.pas:(.text.n_qtwidgets$_$tqtaccessibletreerow_$__$$_create$tlazaccessibleobject$qwidgeth$$tqtaccessibletreerow+0x139): undefined reference to `QLCLAccessibleWidget_override_rect'
/usr/bin/ld: qtwidgets.pas:(.text.n_qtwidgets$_$tqtaccessibletreerow_$__$$_create$tlazaccessibleobject$qwidgeth$$tqtaccessibletreerow+0x152): undefined reference to `QLCLAccessibleWidget_override_role'
/usr/bin/ld: qtwidgets.pas:(.text.n_qtwidgets$_$tqtaccessibletreerow_$__$$_create$tlazaccessibleobject$qwidgeth$$tqtaccessibletreerow+0x16b): undefined reference to `QLCLAccessibleWidget_override_text'
/usr/bin/ld: /home/chris/lazarus/lcl/units/x86_64-linux/qt5/qtwidgets.o: in function `QTWIDGETS$_$TQTACCESSIBLETREEROW_$__$$_PARENTOVERRIDE$QACCESSIBLEINTERFACEH':
qtwidgets.pas:(.text.n_qtwidgets$_$tqtaccessibletreerow_$__$$_parentoverride$qaccessibleinterfaceh+0x25): undefined reference to `QAccessible_queryAccessibleInterface'
/usr/bin/ld: /home/chris/lazarus/lcl/units/x86_64-linux/qt5/qtwscontrols.o: in function `QTWSCONTROLS$_$TQTWSLAZACCESSIBLEOBJECT_$__$$_CREATEHANDLE$TLAZACCESSIBLEOBJECT$$HWND':
qtwscontrols.pp:(.text.n_qtwscontrols$_$tqtwslazaccessibleobject_$__$$_createhandle$tlazaccessibleobject$$hwnd+0x13): undefined reference to `QAccessible_installFactory'
/home/chris/Downloads/QT5/project1.lpr(25,1) Error: (9013) Error while linking
/home/chris/Downloads/QT5/project1.lpr(25,1) Fatal: (10026) There were 1 errors compiling module, stopping
Fatal: (1018) Compilation aborted
Error: /usr/bin/ppcx64 returned an error exitcode
Error: (lazarus) Compile Project, Target: project1: stopped with exit code 1
Error: (lazbuild) failed compiling of project /home/chris/Downloads/QT5/project1.lpi
« Last Edit: April 14, 2021, 03:10:25 pm by ChrisR »

zeljko

  • Hero Member
  • *****
  • Posts: 1591
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: QT5 with latest Lazarus has undefined references
« Reply #1 on: April 06, 2021, 08:57:08 am »
You must use libQt5Pas from lazarus trunk - in other words you must rebuild libQt5Pas on your own since I've added QAccessibility* in trunk.
If you don't want to build libQt5Pas then use stable Lazarus release.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6646
Re: QT5 with latest Lazarus has undefined references
« Reply #2 on: April 06, 2021, 10:10:29 am »
You must use libQt5Pas from lazarus trunk - in other words you must rebuild libQt5Pas on your own since I've added QAccessibility* in trunk.
If you don't want to build libQt5Pas then use stable Lazarus release.

Where is it best installed? Do you have any notes on doing that? I've always assumed that Lazarus + Qt was just a combination that stopped working on occasion.

I can confirm the same problem with lazarus-trunk and Debian "Bullseye" i.e. testing/not-yet-stable.

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

zeljko

  • Hero Member
  • *****
  • Posts: 1591
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: QT5 with latest Lazarus has undefined references
« Reply #3 on: April 06, 2021, 11:09:48 am »
On my linuxmint libQt5Pas is inside /usr/lib/x86_64-linux-gnu
linda@linda-Lenovo-Y520-15IKBN /usr/lib/x86_64-linux-gnu $ ls -al libQt5Pas.so*
lrwxrwxrwx 1 root root       18 tra   4 12:35 libQt5Pas.so -> libQt5Pas.so.1.2.9
lrwxrwxrwx 1 root root       18 tra   4 12:35 libQt5Pas.so.1 -> libQt5Pas.so.1.2.9
lrwxrwxrwx 1 root root       18 tra   4 12:35 libQt5Pas.so.1.2 -> libQt5Pas.so.1.2.9
-rwxr-xr-x 1 root root 88692504 lip   5  2019 libQt5Pas.so.1.2.7
-rwxr-xr-x 1 root root  3663888 tra   4 12:34 libQt5Pas.so.1.2.9

cd lcl/interfaces/qt5/cbindings
qmake -query && qmake && make

You must install qt5 dev packages (don't know exact names)

I've copied libQt5Pas.so.1.2.9 manually after compilation.




MarkMLl

  • Hero Member
  • *****
  • Posts: 6646
Re: QT5 with latest Lazarus has undefined references
« Reply #4 on: April 06, 2021, 11:15:41 am »
cd lcl/interfaces/qt5/cbindings
qmake -query && qmake && make

You must install qt5 dev packages (don't know exact names)

I've copied libQt5Pas.so.1.2.9 manually after compilation.

Install from where: the distro or Lazarus svn?

I'm entirely used to installing libqt*pas from the distro, but your suggestion earlier was that it also existed as part of Lazarus.

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

zeljko

  • Hero Member
  • *****
  • Posts: 1591
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: QT5 with latest Lazarus has undefined references
« Reply #5 on: April 06, 2021, 11:53:47 am »
From lazarus svn. Distro one is missing QAccessibilityWidget implementation.
You cannot use lazarus-qt5 trunk without rebuilding libqt5pas manually.
Distro version will be updated when lazarus-2.2 is out I guess, current distro version is probably 1.2.8,
trunk version is 1.2.9.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6646
Re: QT5 with latest Lazarus has undefined references
« Reply #6 on: April 06, 2021, 12:36:32 pm »
Thanks, I'll investigate and report back.

On Debian "Buster" (stable) libqt4pas-dev is reported as 2.5-18 (I might actually have got that from the previous distro version) and libqt5pas-dev as 2.6~beta-6. On "Bullseye" (testing) libqt5pas-dev is reported as 2.6+2.0.8+dfsg-2... I'm not sure how those versions tie in with the ones you've mentioned

Quote
cd lcl/interfaces/qt5/cbindings
qmake -query && qmake && make

OK, I see the relevant files in my local lazarus-trunk, I'd been indulging in the "recreational impossibility" of finding a repository with an unknown name on the FPC Subversion server :-)

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

AlexTP

  • Hero Member
  • *****
  • Posts: 2365
    • UVviewsoft
Re: QT5 with latest Lazarus has undefined references
« Reply #7 on: April 06, 2021, 12:55:16 pm »
Users need to reinstall libqt5Pas. If they use app from Lazarus trunk.
From 'releases' from here
https://github.com/davidbannon/libqt5pas/

MarkMLl

  • Hero Member
  • *****
  • Posts: 6646
Re: QT5 with latest Lazarus has undefined references
« Reply #8 on: April 06, 2021, 01:43:45 pm »
Users need to reinstall libqt5Pas. If they use app from Lazarus trunk.
From 'releases' from here
https://github.com/davidbannon/libqt5pas/

"Reinstall" doesn't come into it, since OP and myself have the "official" packages from our distro which are potentially signed etc. "Replace" would be more appropriate, but GOK if that would cause backwards compatibility issues.

Noting that the Github repository has been updated today i.e. after OP started the thread:

I think the really useful thing there is https://github.com/davidbannon/libqt5pas/blob/master/cbindings/README.TXT which gives the basic build instructions with the numbering rationale being in https://github.com/davidbannon/libqt5pas/blob/master/README.md

If my understanding is correct Debian's 2.6 corresponds to his 1.2.6 etc.

Building from lazarus/trunk sources looks like a problem on a comparatively clean system, I've got as far as


/usr/local/share/lazarus-trunk/lcl/interfaces/qt5/cbindings$ qmake -query
qmake: could not exec '/usr/lib/qt5/bin/qmake': No such file or directory


...I'll come back to this but right now I've got company accounts to work on.

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

AlexTP

  • Hero Member
  • *****
  • Posts: 2365
    • UVviewsoft
Re: QT5 with latest Lazarus has undefined references
« Reply #9 on: April 06, 2021, 01:56:38 pm »
I've got the same error on build:
qmake: could not exec '/usr/lib/qt5/bin/qmake': No such file or directory

MarkMLl

  • Hero Member
  • *****
  • Posts: 6646
Re: QT5 with latest Lazarus has undefined references
« Reply #10 on: April 06, 2021, 02:29:13 pm »
The basic  qmake -query  works on a more mature system (both Debian).

Both systems obviously have libqt5pas-dev, the more mature system also has libqt5opengl5-dev:amd64 qtbase5-dev:amd64 qtbase5-dev-tools qttools5-dev-tools.

dpkg -S /usr/bin/qmake  says it's from qtchooser, but that's definitely not something I've installed manually. I log package installation fairly carefully but what it doesn't show is the actual command like and the "top level" package that pulled other stuff in.

MarkMLl

« Last Edit: April 06, 2021, 02:51:36 pm 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

dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy
Re: QT5 with latest Lazarus has undefined references
« Reply #11 on: April 06, 2021, 02:55:15 pm »
The way I understood it, you only needed the new libqt5pas libraries if you are using the specific features zeljko has just added. Thats what happened in the past and is workable. However, that is not the case now and I am afraid things appear to be seriously broken.

I have just pulled down Lazarus trunk and tried to build my app on a U20.04 machine with std repo versions of libqt5pas and it fails. Prior to the recent accessibility additions it works fine. This means that anyone using trunk now must use the libraries for my github if they use Qt5 apps, end users as well as developers. 

I am quite sure that was not the intended outcome and suggest it needs to be reversed.

Davo

Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

MarkMLl

  • Hero Member
  • *****
  • Posts: 6646
Re: QT5 with latest Lazarus has undefined references
« Reply #12 on: April 06, 2021, 03:20:22 pm »
I'm watching with interest. In the interim do you have any suggestion what packages are the minimum required for building? I think that would be of interest to anybody who occasionally rebuilds lazarus-trunk since by and large we'd expect to have the development tools and libraries applicable to our OS etc. available as a prerequisite.

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

dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy
Re: QT5 with latest Lazarus has undefined references
« Reply #13 on: April 06, 2021, 03:24:48 pm »
"Replace" would be more appropriate, ...

Yes, its definitely a replace.

Quote from: MarkMLl
..... with the numbering rationale being in https://github.com/davidbannon/libqt5pas/blob/master/README.md

If my understanding is correct Debian's 2.6 corresponds to his 1.2.6 etc.

Yes, sort of.  The main library is libqt5pas1 and version 2.6 but the dev package drops the '1', Debian versioning is a very arcane art.

Anyway, its been called 1.2.6 for a long time while zeljko has been making incremental changes.  All those changes, up to now, have been backwards compatible.  The distros have been using an incredibly ugly version number like 1.2.6~beta-6build1 and that '~' is an absolute menace. Zeljko agreed to call it 1.2.8 last time around to get rid of the '~' and to ensure a higher version number than 1.2.6something.  To avoid auto updates from breaking things.

But the point is, until this recent change, only quite old distros eg U18.04 and friends, needed to worry about it.  Suddenly, we have a backwards compatibility issue !

Quote from: MarkMLl
Building from lazarus/trunk sources looks like a problem on a comparatively clean system,

Its not hard, slow, you will need qmake and libqt5x11extras-dev. Probably will have everything else.  But our end users ?  Thats a very different situation !

Don't worry about the qmake -query, just proceed to qmake qt=qt5. Or use mine from the github repo, no back doors, I promise !

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

dbannon

  • Hero Member
  • *****
  • Posts: 2778
    • tomboy-ng, a rewrite of the classic Tomboy
Re: QT5 with latest Lazarus has undefined references
« Reply #14 on: April 06, 2021, 03:32:46 pm »
I'm watching with interest. In the interim do you have any suggestion what packages are the minimum required for building? I think that would be of interest to anybody who occasionally rebuilds lazarus-trunk since by and large we'd expect to have the development tools and libraries applicable to our OS etc. available as a prerequisite.

MarkMLl

As I mentioned above, qmake and libqt5x11extras-dev. Probably will have everything else.

But if this change makes it through to release Lazarus, in say, 2.1.0, QT5 will be useless for any app thats going to be distributed until the distros catch up. And that is a matter of several years. U20.04 is probably good until 2024 ....

Debian Testing is in a feature freeze mode now, wonder if we should be pushing to get this "new and improved" lib into it ?  Will have to test to see it does not break Lazarus 2.0.12 for example. Sigh ...

Davo

Davo
Lazarus 2, Linux (and reluctantly Win10, OSX)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

 

TinyPortal © 2005-2018