GauiStori / PyQt-Qwt

Python PyQt wrapper for Qwt6
Other
53 stars 18 forks source link

Runtime error - undefined symbol: _ZTI14QwtAnalogClock #16

Closed cmorgenstern closed 3 years ago

cmorgenstern commented 3 years ago

Related to post by @ekigwana in https://github.com/GauiStori/PyQt-Qwt/issues/3#issuecomment-394787379

OS: Arch Linux 5.10.16-arch1-1 x86_64 GNU/Linux PyQt-Qwt version: 1.02.02

Compile method:

sip-build --verbose --qwt-incdir=/usr/include/qwt --qwt-libdir=/usr/lib

I am getting the following runtime error when trying to execute any of the Qt 5 examples provided:

$ python animation.py 
Traceback (most recent call last):
  File "/home/user/chroot/pkgbuilds/pyqt-qwt/src/PyQt-Qwt-1.02.02/qt5examples/animation.py", line 6, in <module>
    from PyQt5 import Qwt
ImportError: /usr/lib/python3.9/site-packages/PyQt5/Qwt.cpython-39-x86_64-linux-gnu.so: undefined symbol: _ZTI14QwtAnalogClock

Listing out the symbols (dynamic), I can see it, though:

$ nm -D /usr/lib/python3.9/site-packages/PyQt5/Qwt.cpython-39-x86_64-linux-gnu.so | grep _ZTI14QwtAnalogClock
                 U _ZTI14QwtAnalogClock

Is there something I'm missing when compiling? I tried building PyQt-Qwt using Qwt with the patched headers but got the same runtime error subsequently.

GauiStori commented 3 years ago

Hi Charles

Sorry for a late answer.

What is the output of ldd? On my computer it is: ldd /usr/lib/python3/dist-packages/PyQt5/Qwt.cpython-39-x86_64-linux-gnu.so linux-vdso.so.1 (0x00007fffb053a000) libqwt-qt5.so.6 => /usr/lib/libqwt-qt5.so.6 (0x00007f4d6b9e9000)

Does the Animation example work in Qwt C++ library?

Regards Gudjon

On Thursday, 18 February 2021 10:34:24 CET Charles Wise wrote:

Related to post by @ekigwana in https://github.com/GauiStori/PyQt-Qwt/issues/3#issuecomment-394787379

OS: Arch Linux 5.10.16-arch1-1 x86_64 GNU/Linux PyQt-Qwt version: 1.02.02

Compile method:

sip-build --verbose --qwt-incdir=/usr/include/qwt --qwt-libdir=/usr/lib

I am getting the following runtime error when trying to execute any of the Qt 5 examples provided: [user@laptop ~/chroot/pkgbuilds/pyqt-qwt/src/PyQt-Qwt-1.02.02/qt5examples]$ python animation.py Traceback (most recent call last): File "/home/user/chroot/pkgbuilds/pyqt-qwt/src/PyQt-Qwt-1.02.02/qt5examples/anim ation.py", line 6, in <module> from PyQt5 import Qwt ImportError: /usr/lib/python3.9/site-packages/PyQt5/Qwt.cpython-39-x86_64-linux-gnu.so: undefined symbol: _ZTI14QwtAnalogClock

Listing out the symbols (dynamic), I can see it, though:

[user@laptop ~]$ `

Is there something I'm missing when compiling? I tried building PyQt-Qwt using Qwt with the patched headers but got the same runtime error subsequently.

cmorgenstern commented 3 years ago

No worries, thanks for getting back to me. Here is the ldd output for the compiled module:

[root@laptop ~]# ldd /usr/lib/python3.9/site-packages/PyQt5/Qwt.cpython-39-x86_64-linux-gnu.so
    linux-vdso.so.1 (0x00007ffdbfdf7000)
    libQt5Widgets.so.5 => /usr/lib/libQt5Widgets.so.5 (0x00007fe13702d000)
    libQt5Gui.so.5 => /usr/lib/libQt5Gui.so.5 (0x00007fe13695f000)
    libQt5Core.so.5 => /usr/lib/libQt5Core.so.5 (0x00007fe13640a000)
    libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007fe13622d000)
    libc.so.6 => /usr/lib/libc.so.6 (0x00007fe136060000)
    libm.so.6 => /usr/lib/libm.so.6 (0x00007fe135f1b000)
    libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x00007fe135eff000)
    libpthread.so.0 => /usr/lib/libpthread.so.0 (0x00007fe135ede000)
    libGL.so.1 => /usr/lib/libGL.so.1 (0x00007fe135e58000)
    libpng16.so.16 => /usr/lib/libpng16.so.16 (0x00007fe135e21000)
    libz.so.1 => /usr/lib/libz.so.1 (0x00007fe135e07000)
    libharfbuzz.so.0 => /usr/lib/libharfbuzz.so.0 (0x00007fe135d33000)
    libmd4c.so.0 => /usr/lib/libmd4c.so.0 (0x00007fe135d1c000)
    libsystemd.so.0 => /usr/lib/libsystemd.so.0 (0x00007fe135c66000)
    libdouble-conversion.so.3 => /usr/lib/libdouble-conversion.so.3 (0x00007fe135c4f000)
    libicui18n.so.68 => /usr/lib/libicui18n.so.68 (0x00007fe135930000)
    libicuuc.so.68 => /usr/lib/libicuuc.so.68 (0x00007fe135741000)
    libdl.so.2 => /usr/lib/libdl.so.2 (0x00007fe13573a000)
    libpcre2-16.so.0 => /usr/lib/libpcre2-16.so.0 (0x00007fe1356ad000)
    libzstd.so.1 => /usr/lib/libzstd.so.1 (0x00007fe1355d2000)
    libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x00007fe13549d000)
    /usr/lib64/ld-linux-x86-64.so.2 (0x00007fe137876000)
    libGLdispatch.so.0 => /usr/lib/libGLdispatch.so.0 (0x00007fe1353e6000)
    libGLX.so.0 => /usr/lib/libGLX.so.0 (0x00007fe1353b3000)
    libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007fe1352dd000)
    libgraphite2.so.3 => /usr/lib/libgraphite2.so.3 (0x00007fe1352b8000)
    librt.so.1 => /usr/lib/librt.so.1 (0x00007fe1352ad000)
    liblzma.so.5 => /usr/lib/liblzma.so.5 (0x00007fe135285000)
    liblz4.so.1 => /usr/lib/liblz4.so.1 (0x00007fe135262000)
    libgcrypt.so.20 => /usr/lib/libgcrypt.so.20 (0x00007fe135130000)
    libicudata.so.68 => /usr/lib/libicudata.so.68 (0x00007fe1335ed000)
    libpcre.so.1 => /usr/lib/libpcre.so.1 (0x00007fe13357b000)
    libX11.so.6 => /usr/lib/libX11.so.6 (0x00007fe13343a000)
    libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x00007fe133427000)
    libgpg-error.so.0 => /usr/lib/libgpg-error.so.0 (0x00007fe133400000)
    libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007fe1333d4000)
    libXau.so.6 => /usr/lib/libXau.so.6 (0x00007fe1333cf000)
    libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007fe1333c7000)

Looks like the library is missing a shared object dependency on libqwt-qt5.so.6 - as my system is not Debian, the object is simply libqwt.so:

[root@laptop ~]# ls -lartch /usr/lib/libqwt*
lrwxrwxrwx 1 root root   15 Feb 18 01:39 /usr/lib/libqwt.so.6.1 -> libqwt.so.6.1.6
lrwxrwxrwx 1 root root   15 Feb 18 01:39 /usr/lib/libqwt.so.6 -> libqwt.so.6.1.6
lrwxrwxrwx 1 root root   15 Feb 18 01:39 /usr/lib/libqwt.so -> libqwt.so.6.1.6
-rwxr-xr-x 1 root root 1.4M Feb 18 01:39 /usr/lib/libqwt.so.6.1.6

How would I test whether the animation example works with the Qwt C++ library?

GauiStori commented 3 years ago

Hi Charles

On Friday, 26 February 2021 20:41:30 CET Charles Wise wrote: ...

Looks like the library is missing a shared object dependency on libqwt-qt5.so.6 - as my system is not Debian, the object is simply libqwt.so: ``` [root@lenovo ~]# ls -lartch /usr/lib/libqwt* lrwxrwxrwx 1 root root 15 Feb 18 01:39 /usr/lib/libqwt.so.6.1 -> libqwt.so.6.1.6 lrwxrwxrwx 1 root root 15 Feb 18 01:39 /usr/lib/libqwt.so.6 -> libqwt.so.6.1.6 lrwxrwxrwx 1 root root 15 Feb 18 01:39 /usr/lib/libqwt.so -> libqwt.so.6.1.6 -rwxr-xr-x 1 root root 1.4M Feb 18 01:39 /usr/lib/libqwt.so.6.1.6 I will make an addition Readme file. On Debian systems Qwt for Qt4 and Qt5 can coexist. That is why the library names are changed. I guess recompiling the library without the --qwt-lib=qwt-qt5 parameter will fix your problem.

How would I test whether the animation example works with the Qwt C++ library? Just download the Qwt library and compile the examples with qmake but unnecessary if the solution above works.

Regards Gudjon

cmorgenstern commented 3 years ago

I was able to resolve the issue by re-compiling and specifying --qwt-lib=qwt:

sip-build --verbose --qwt-incdir=/usr/include/qwt --qwt-libdir=/usr/lib --qwt-lib=qwt

I can now successfully execute the included Qt 5 examples. Thanks for the help!