我正在尝试部署我的应用程序。我创建了一个 deb 包。如果我将它安装在我构建它的同一台机器上,一切正常。当我尝试在 gitlab 上使用我的 CI 设置生成的 deb 包时,我遇到了问题。
安装完之后,出现以下错误:
$ NCATests
NCATests: error while loading shared libraries: libQt5Core.so.5: cannot open shared object file: No such file or directory
/etc/ld.so.conf.d/nca.conf
这很令人惊讶,因为我安装了一个带有路径的conf 文件 ( )/usr/lib/nca
并运行了安装后的 ldconfig。为了确保它有效,我运行了:
$ ldconfig -v
(snip)
/usr/lib/nca:
libpcre2-16.so.0 -> libpcre2-16.so.0.7.1
libicuuc.so.63 -> libicuuc.so.63.1
libicui18n.so.63 -> libicui18n.so.63.1
libicudata.so.63 -> libicudata.so.63.1
libdouble-conversion.so.1 -> libdouble-conversion.so.1.0
libQt5Widgets.so.5 -> libQt5Widgets.so.5.11.3
libQt5Test.so.5 -> libQt5Test.so.5.11.3
libQt5Gui.so.5 -> libQt5Gui.so.5.11.3
libQt5DBus.so.5 -> libQt5DBus.so.5.11.3
libQt5Core.so.5 -> libQt5Core.so.5.11.3
libNCACore.so.1 -> libNCACore.so.1.3.8
(snip)
但是:
$ ldd /usr/bin/NCATests
linux-vdso.so.1 (0x00007fffc1081000)
libNCACore.so.1 => /usr/lib/nca/libNCACore.so.1 (0x00007f049a368000)
libQt5Test.so.5 => /usr/lib/nca/libQt5Test.so.5 (0x00007f049a310000)
libQt5Core.so.5 => not found
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f049a0f0000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f0499d60000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f04999c0000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f0499790000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f0499390000)
/lib64/ld-linux-x86-64.so.2 (0x00007f049a600000)
libQt5Core.so.5 => not found
libQt5Core.so.5 => not found
图书馆在那里:
$ ll /usr/lib/nca | grep 5Core
lrwxrwxrwx 1 root root 20 Mar 15 08:20 libQt5Core.so.5 -> libQt5Core.so.5.11.3
lrwxrwxrwx 1 root root 20 Mar 15 08:20 libQt5Core.so.5.11 -> libQt5Core.so.5.11.3
-rw-r--r-- 1 root root 5200168 Mar 15 08:20 libQt5Core.so.5.11.3
两个文件都是 64 位的:
$ file /usr/bin/NCATests
/usr/bin/NCATests: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=8adef8969237a756f7d2743121f87791c8ceafc2, not stripped
$ file /usr/lib/nca/libQt5Core.so.5.11.3
/usr/lib/nca/libQt5Core.so.5.11.3: ELF 64-bit LSB shared object, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=b126d6e6aafc3d2d6e2b7904786b22e7e84e252e, for GNU/Linux 3.17.0, stripped
Ubuntu 版本 18.04。这里有什么问题?
答案1
sudo apt install libqt5core5a
这是你丢失的库