当应用程序的发布版本 v5.6 正在使用时,如何使我的发行版的 libQtCore v5.10.1 可用?

当应用程序的发布版本 v5.6 正在使用时,如何使我的发行版的 libQtCore v5.10.1 可用?

1) 当我从命令行启动 Understand 时,我看到以下内容。一切正常。:

[me@box1 ~]# understand

2)在“入门”标题下的“入门”选项卡上:

当我单击“了解帮助...”、“了解常见问题...”、“了解 Perl API 帮助...”、“了解 Python API 帮助...”和“SciTools 支持...”中的任何链接以及“帮助”菜单中的相同链接时,以下错误会添加到终端窗口,并且什么也不会发生:

[me@box1 4.4.19 vpn-client]# understand
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by kde-open5)
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by /usr/lib/libKF5KIOWidgets.so.5)
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by /usr/lib/libKF5KIOCore.so.5)
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by /usr/lib/libKF5I18n.so.5)
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by /usr/lib/libKF5CoreAddons.so.5)
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by /usr/lib/libKF5JobWidgets.so.5)
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by /usr/lib/libKF5Service.so.5)
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by /usr/lib/libKF5Completion.so.5)
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by /usr/lib/libKF5IconThemes.so.5)
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by /usr/lib/libKF5WindowSystem.so.5)
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by /usr/lib/libKF5ConfigWidgets.so.5)
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by /usr/lib/libKF5WidgetsAddons.so.5)
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by /usr/lib/libKF5ConfigGui.so.5)
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by /usr/lib/libKF5ConfigCore.so.5)
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by /usr/lib/libQt5DBus.so.5)
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by /usr/lib/libKF5DBusAddons.so.5)
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by /usr/lib/libKF5Auth.so.5)
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by /usr/lib/libQt5X11Extras.so.5)
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by /usr/lib/libQt5Svg.so.5)
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by /usr/lib/libKF5Archive.so.5)
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by /usr/lib/libKF5ItemViews.so.5)
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by /usr/lib/libKF5Codecs.so.5)
kde-open5: /home/me/bin/scitools/bin/linux64/libQt5Core.so.5: version 'Qt_5.10' not found (required by /usr/lib/libKF5GuiAddons.so.5)

3)qmake通知我Qt v5.10.1已由我的发行版(Arch Linux)安装:

[me@box1 ~]# qmake -version
QMake version 3.1
Using Qt version 5.10.1 in /usr/lib

4)readelf通知我(并确认的qmake输出)我的发行版安装了 Qt Core v5.10.1:

[me@box1 ~]# readelf -V /usr/lib/libQt5Core.so.5.10.1 | grep -ie 'Qt_5\.'
  d7c:   9h(Qt_5.5)        bh(Qt_5.7)        e (Qt_5.10)       3 (Qt_5)       
  d80:   5h(Qt_5.1)        ch(Qt_5.8)        7h(Qt_5.3)        8h(Qt_5.4)     
  d84:   ah(Qt_5.6)        dh(Qt_5.9)        4h(Qt_5.0)        6h(Qt_5.2)     
  149c:   3 (Qt_5)          e (Qt_5.10)       3 (Qt_5)          2 (Qt_5_PRIVATE_API)   
  14c0:   3 (Qt_5)          4 (Qt_5.0)        3 (Qt_5)          3 (Qt_5)       
  14c4:   3 (Qt_5)          3 (Qt_5)          5 (Qt_5.1)        3 (Qt_5)       
  14c8:   6 (Qt_5.2)        2 (Qt_5_PRIVATE_API)      7 (Qt_5.3)        3 (Qt_5)       
  14cc:   8 (Qt_5.4)        3 (Qt_5)          3 (Qt_5)          3 (Qt_5)       
  14d0:   3 (Qt_5)          3 (Qt_5)          9 (Qt_5.5)        3 (Qt_5)       
  14d4:   3 (Qt_5)          a (Qt_5.6)        3 (Qt_5)          3 (Qt_5)       
  14d8:   3 (Qt_5)          2 (Qt_5_PRIVATE_API)      b (Qt_5.7)        3 (Qt_5)       
  14dc:   2 (Qt_5_PRIVATE_API)      3 (Qt_5)          c (Qt_5.8)        3 (Qt_5)       
  14e0:   3 (Qt_5)          d (Qt_5.9)        3 (Qt_5)          2 (Qt_5_PRIVATE_API)   
  0x0054: Rev: 1  Flags: none  Index: 4  Cnt: 2  Name: Qt_5.0
  0x0078: Rev: 1  Flags: none  Index: 5  Cnt: 2  Name: Qt_5.1
  0x0094: Parent 1: Qt_5.0
  0x009c: Rev: 1  Flags: none  Index: 6  Cnt: 2  Name: Qt_5.2
  0x00b8: Parent 1: Qt_5.1
  0x00c0: Rev: 1  Flags: none  Index: 7  Cnt: 2  Name: Qt_5.3
  0x00dc: Parent 1: Qt_5.2
  0x00e4: Rev: 1  Flags: none  Index: 8  Cnt: 2  Name: Qt_5.4
  0x0100: Parent 1: Qt_5.3
  0x0108: Rev: 1  Flags: none  Index: 9  Cnt: 2  Name: Qt_5.5
  0x0124: Parent 1: Qt_5.4
  0x012c: Rev: 1  Flags: none  Index: 10  Cnt: 2  Name: Qt_5.6
  0x0148: Parent 1: Qt_5.5
  0x0150: Rev: 1  Flags: none  Index: 11  Cnt: 2  Name: Qt_5.7
  0x016c: Parent 1: Qt_5.6
  0x0174: Rev: 1  Flags: none  Index: 12  Cnt: 2  Name: Qt_5.8
  0x0190: Parent 1: Qt_5.7
  0x0198: Rev: 1  Flags: none  Index: 13  Cnt: 2  Name: Qt_5.9
  0x01b4: Parent 1: Qt_5.8
  0x01bc: Rev: 1  Flags: none  Index: 14  Cnt: 2  Name: Qt_5.10
  0x01d8: Parent 1: Qt_5.9

5)readelf通知我 Understand 随 Qt v5.6 一起提供:

[me@box1 ~]# readelf -V /home/me/bin/scitools/bin/linux64/libQt5Core.so.5 | grep -ie 'Qt_5\.'
  9e8:   3 (Qt_5)          3 (Qt_5)          4 (Qt_5.0)        2 (Qt_5_PRIVATE_API)   
  9ec:   3 (Qt_5)          3 (Qt_5)          5 (Qt_5.1)        3 (Qt_5)       
  9f0:   6 (Qt_5.2)        3 (Qt_5)          2 (Qt_5_PRIVATE_API)      3 (Qt_5)       
  9f4:   2 (Qt_5_PRIVATE_API)      7 (Qt_5.3)        3 (Qt_5)          8 (Qt_5.4)     
  9f8:   3 (Qt_5)          3 (Qt_5)          9 (Qt_5.5)        3 (Qt_5)       
  9fc:   3 (Qt_5)          3 (Qt_5)          a (Qt_5.6)        2 (Qt_5_PRIVATE_API)   
  d90:   3 (Qt_5)          5h(Qt_5.1)        4h(Qt_5.0)        a (Qt_5.6)     
  d94:   8h(Qt_5.4)        9h(Qt_5.5)        6h(Qt_5.2)        7h(Qt_5.3)     
  0x0054: Rev: 1  Flags: none  Index: 4  Cnt: 2  Name: Qt_5.0
  0x0078: Rev: 1  Flags: none  Index: 5  Cnt: 2  Name: Qt_5.1
  0x0094: Parent 1: Qt_5.0
  0x009c: Rev: 1  Flags: none  Index: 6  Cnt: 2  Name: Qt_5.2
  0x00b8: Parent 1: Qt_5.1
  0x00c0: Rev: 1  Flags: none  Index: 7  Cnt: 2  Name: Qt_5.3
  0x00dc: Parent 1: Qt_5.2
  0x00e4: Rev: 1  Flags: none  Index: 8  Cnt: 2  Name: Qt_5.4
  0x0100: Parent 1: Qt_5.3
  0x0108: Rev: 1  Flags: none  Index: 9  Cnt: 2  Name: Qt_5.5
  0x0124: Parent 1: Qt_5.4
  0x012c: Rev: 1  Flags: none  Index: 10  Cnt: 2  Name: Qt_5.6
  0x0148: Parent 1: Qt_5.5

6)ldd通知我 Understand 将使用其发布的 Qt 版本:

[me@box1 ~]# ldd /home/me/bin/scitools/bin/linux64/understand.bin | grep -ie 'scitools'
        libQt5Concurrent.so.5 => /home/me/bin/scitools/bin/linux64/libQt5Concurrent.so.5 (0x00007f0a63b77000)
        libQt5Sql.so.5 => /home/me/bin/scitools/bin/linux64/libQt5Sql.so.5 (0x00007f0a63af9000)
        libQt5Network.so.5 => /home/me/bin/scitools/bin/linux64/libQt5Network.so.5 (0x00007f0a624dd000)
        libQt5Xml.so.5 => /home/me/bin/scitools/bin/linux64/libQt5Xml.so.5 (0x00007f0a63abd000)
        libQt5PrintSupport.so.5 => /home/me/bin/scitools/bin/linux64/libQt5PrintSupport.so.5 (0x00007f0a63a4d000)
        libastyle.so => /home/me/bin/scitools/bin/linux64/libastyle.so (0x00007f0a6229a000)
        libQt5Widgets.so.5 => /home/me/bin/scitools/bin/linux64/libQt5Widgets.so.5 (0x00007f0a61c12000)
        libQt5Gui.so.5 => /home/me/bin/scitools/bin/linux64/libQt5Gui.so.5 (0x00007f0a61732000)
        libQt5Core.so.5 => /home/me/bin/scitools/bin/linux64/libQt5Core.so.5 (0x00007f0a6117a000)

understand7)启动的Bash脚本understand.bin包含以下内容:

#!/bin/bash
scriptdir=`dirname $0`
export LD_LIBRARY_PATH=$scriptdir
unset QT_PLUGIN_PATH
$0.bin "$@"

8)复制understand脚本并添加以下行,echo "\$LD_LIBRARY_PATH after === $LD_LIBRARY_PATH"显示其设置为:

$LD_LIBRARY_PATH after === /home/me/bin/scitools/bin/linux64

9) 显然,抛出错误的库正在寻找 Qt v5.10 Core 库。但却找到了 Understand 附带的 Qt v5.6 Core 库。

因此我使用以下命令添加了指向 understand 目录的符号链接:

[me@box1 ~]# ln -sf /usr/lib/libQt5Core.so.5.10.1 /home/me/bin/scitools/bin/linux64/libQt5Core.so.5.10

但这并没有改变什么。

然后,我继续更改“理解” Bash 脚本的副本(understand-test),并将行更改export LD_LIBRARY_PATH=$scriptdirexport LD_LIBRARY_PATH=$scriptdir:/usr/lib。但这也没有改变任何东西。

尽管 /home/me/bin/scitools/bin/linux64/libQt5Core.so.5 (v5.6)正在使用中,我该怎么做才能使库像 /usr/lib/libKF5KIOWidgets.so.5 /usr/lib/libKF5KIOCore.so.5等查找并使用 v5.10.1 /usr/lib/libQt5Core.so.5.10.1

答案1

通常,库在各个次要版本之间是向后兼容的,因此您应该能够使用系统 Qt5 而不是提供的版本。您可以通过删除 5.6 库文件来实现这一点,或者如果这些是该目录中唯一重要的库文件,那么您可以完全省略$LD_LIBRARY_PATH

相关内容