Recent

Author Topic: [SOLVED] "Hello World" for qt5 compiles, but runtime throws EAccessViolation  (Read 3310 times)

Lutz Mändle

  • Jr. Member
  • **
  • Posts: 72
Re: "Hello World" for qt5 compiles, but runtime throws EAccessViolation
« Reply #15 on: July 21, 2024, 07:52:17 am »
@Hartmut

what is the output of the ldd command with the binary of your Hello World program, like this:

Code: Text  [Select][+][-]
  1. maendle@lutz-nb:/devel/FPC-Projekte/Demos/qt5test/output> ldd project1
  2.         linux-vdso.so.1 (0x00007f17657f2000)
  3.         libQt5Pas.so.1 => /lib64/libQt5Pas.so.1 (0x00007f1765400000)
  4.         libX11.so.6 => /lib64/libX11.so.6 (0x00007f17652ba000)
  5.         libc.so.6 => /lib64/libc.so.6 (0x00007f1765000000)
  6.         libQt5PrintSupport.so.5 => /lib64/libQt5PrintSupport.so.5 (0x00007f1765730000)
  7.         libQt5Widgets.so.5 => /lib64/libQt5Widgets.so.5 (0x00007f1764800000)
  8.         libQt5X11Extras.so.5 => /lib64/libQt5X11Extras.so.5 (0x00007f1765729000)
  9.         libQt5Gui.so.5 => /lib64/libQt5Gui.so.5 (0x00007f1764000000)
  10.         libQt5Network.so.5 => /lib64/libQt5Network.so.5 (0x00007f1763e4a000)
  11.         libQt5Core.so.5 => /lib64/libQt5Core.so.5 (0x00007f1763800000)
  12. ........
  13. <snip>
  14.  

Here you can see, which libQt5Pas.so.1 is in use.

Hartmut

  • Hero Member
  • *****
  • Posts: 843
Re: "Hello World" for qt5 compiles, but runtime throws EAccessViolation
« Reply #16 on: July 21, 2024, 09:52:18 am »
@Lutz Mändle:
Thank you Lutz for this very interesting idea. Here comes the output of the ldd command with the binary of my "Hello World" program (compiled with Lazarus 2.0.10 / FPC 3.2.0):

Code: Text  [Select][+][-]
  1. hg6@i3300:/hg/utis$ ldd project1
  2.         linux-vdso.so.1 (0x00007ffc2efd4000)
  3.         libQt5Pas.so.1 => /lib/x86_64-linux-gnu/libQt5Pas.so.1 (0x00007fece8c23000)
  4.         libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007fece8ae3000)
  5.         libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fece88ba000)
  6.         libQt5PrintSupport.so.5 => /lib/x86_64-linux-gnu/libQt5PrintSupport.so.5 (0x00007fece8842000)
  7.         libQt5Widgets.so.5 => /lib/x86_64-linux-gnu/libQt5Widgets.so.5 (0x00007fece8181000)
  8.         libQt5X11Extras.so.5 => /lib/x86_64-linux-gnu/libQt5X11Extras.so.5 (0x00007fece817a000)
  9.         libQt5Gui.so.5 => /lib/x86_64-linux-gnu/libQt5Gui.so.5 (0x00007fece7a9a000)
  10.         libQt5Network.so.5 => /lib/x86_64-linux-gnu/libQt5Network.so.5 (0x00007fece78e9000)
  11.         libQt5Core.so.5 => /lib/x86_64-linux-gnu/libQt5Core.so.5 (0x00007fece738a000)
  12.         libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fece715e000)
  13.         libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fece713e000)
  14.         libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fece7114000)
  15.         /lib64/ld-linux-x86-64.so.2 (0x00007fece8ee0000)
  16.         libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fece702b000)
  17.         libGL.so.1 => /lib/x86_64-linux-gnu/libGL.so.1 (0x00007fece6fa4000)
  18.         libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007fece6f69000)
  19.         libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fece6f4d000)
  20.         libharfbuzz.so.0 => /lib/x86_64-linux-gnu/libharfbuzz.so.0 (0x00007fece6e7e000)
  21.         libmd4c.so.0 => /lib/x86_64-linux-gnu/libmd4c.so.0 (0x00007fece6e6c000)
  22.         libgssapi_krb5.so.2 => /lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007fece6e16000)
  23.         libdouble-conversion.so.3 => /lib/x86_64-linux-gnu/libdouble-conversion.so.3 (0x00007fece6e01000)
  24.         libicui18n.so.70 => /lib/x86_64-linux-gnu/libicui18n.so.70 (0x00007fece6ad2000)
  25.         libicuuc.so.70 => /lib/x86_64-linux-gnu/libicuuc.so.70 (0x00007fece68d7000)
  26.         libpcre2-16.so.0 => /lib/x86_64-linux-gnu/libpcre2-16.so.0 (0x00007fece684d000)
  27.         libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007fece677e000)
  28.         libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fece6642000)
  29.         libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007fece663c000)
  30.         libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fece6634000)
  31.         libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007fece657c000)
  32.         libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007fece6548000)
  33.         libfreetype.so.6 => /lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007fece647e000)
  34.         libgraphite2.so.3 => /lib/x86_64-linux-gnu/libgraphite2.so.3 (0x00007fece6457000)
  35.         libkrb5.so.3 => /lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007fece638c000)
  36.         libk5crypto.so.3 => /lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007fece635d000)
  37.         libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007fece6357000)
  38.         libkrb5support.so.0 => /lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007fece6349000)
  39.         libicudata.so.70 => /lib/x86_64-linux-gnu/libicudata.so.70 (0x00007fece4729000)
  40.         libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fece46b3000)
  41.         libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007fece469b000)
  42.         libbrotlidec.so.1 => /lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007fece468d000)
  43.         libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007fece4686000)
  44.         libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007fece4670000)
  45.         libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x00007fece4663000)
  46.         libbrotlicommon.so.1 => /lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x00007fece4640000)
  47. hg6@i3300:/hg/utis$

I marked all lines with "qt" in yellow. For me as a novice to this command this result looks ok. Do you agree?

@dbannon:
Thank you Davo for this detailed explanations. There is only 1 question left: if I want to deinstall your 2 packages one day: how can I do this? The "normal" way via Synaptic or sudo apt purge <packagename> ?

dbannon

  • Hero Member
  • *****
  • Posts: 3156
    • tomboy-ng, a rewrite of the classic Tomboy
Re: "Hello World" for qt5 compiles, but runtime throws EAccessViolation
« Reply #17 on: July 21, 2024, 10:30:29 am »
... if I want to deinstall your 2 packages one day: how can I do this? The "normal" way via Synaptic or sudo apt purge <packagename> ?
Because you are installing them using apt, they end up in the apt database, just the same as any other installed package. So, you can remove them with synaptic, gdebi or the apt command line.

You rarely need 'purge' with things as simple as libraries, 'remove' is fine, all that gets installed is one file and a few symlinks.

Davo

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

Lutz Mändle

  • Jr. Member
  • **
  • Posts: 72
Re: "Hello World" for qt5 compiles, but runtime throws EAccessViolation
« Reply #18 on: July 21, 2024, 11:03:23 am »
@Hartmut
The output of the ldd command looks ok.
So the next question is, what is the used QT version? According to an earlier post I guess it is 5.15.3 but the output of qmake -v gives the answer.

@dbannon
Which QT version is used for building your libQt5Pas for x86_64 architecture and which gcc is used?

Thanks in advance.

Hartmut

  • Hero Member
  • *****
  • Posts: 843
Re: "Hello World" for qt5 compiles, but runtime throws EAccessViolation
« Reply #19 on: July 21, 2024, 05:29:55 pm »
@Lutz Mändle:
Here comes the answer to your question:

hg6@i3300:~$ qmake -v
QMake version 3.1
Using Qt version 5.15.3 in /usr/lib/x86_64-linux-gnu
hg6@i3300:~$

@dbannon:
Thanks Davo for clarification. I'm a beginner to that stuff and wanted to understand and to learn.

Meanwhile I installed your libQt5Pas 1.2.15 successfully and it works (together with Lazarus 3.4 and FPC 3.2.2): my "Hello World" now compiles and runs! And my "real project" too!

Thanks a lot again to all who helped me. This is a great forum.

 

TinyPortal © 2005-2018