Problem with linking to libQt6Network.so.6
-
I've got two executables, both built using CMake. Both specify:
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Gui Qt6::Widgets Qt6::Network Qt6::Charts DeepSkyStackerKernel ZClass )One runs just fine. The other gives me a nastygram:
/home/amonra/.vs/DSS/out/build/DeepSkyStackerLive/DeepSkyStackerLive: error while loading shared libraries: libQt6Network.so.6: cannot open shared object file: No such file or directoryHere's the result of running ldd on the two files:
amonra@styx:~/.vs/DSS/out/build/DeepSkyStackerLive$ ldd DeepSkyStackerLive linux-vdso.so.1 (0x00007ffe91193000) libQt6Charts.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6Charts.so.6 (0x00007fa378953000) libcfitsio.so.10 => /usr/local/lib/libcfitsio.so.10 (0x00007fa378670000) libSmtpMime.so.2 => /usr/local/lib/libSmtpMime.so.2 (0x00007fa37862e000) libQt6Widgets.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6Widgets.so.6 (0x00007fa377e85000) libQt6Gui.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6Gui.so.6 (0x00007fa3773f5000) libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007fa3773bf000) libOpenGL.so.0 => /lib/x86_64-linux-gnu/libOpenGL.so.0 (0x00007fa377393000) libQt6Core.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6Core.so.6 (0x00007fa376cbc000) libgomp.so.1 => /lib/x86_64-linux-gnu/libgomp.so.1 (0x00007fa376c68000) libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fa3769fb000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa376914000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fa3768ee000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa3766c5000) /lib64/ld-linux-x86-64.so.2 (0x00007fa379643000) libQt6OpenGLWidgets.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6OpenGLWidgets.so.6 (0x00007fa3766b3000) libQt6OpenGL.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6OpenGL.so.6 (0x00007fa376606000) libGL.so.1 => /lib/x86_64-linux-gnu/libGL.so.1 (0x00007fa37657f000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa37657a000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fa37655c000) libQt6Network.so.6 => not found libxkbcommon.so.0 => /lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007fa376515000) libEGL.so.1 => /lib/x86_64-linux-gnu/libEGL.so.1 (0x00007fa376502000) libfontconfig.so.1 => /lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007fa3764b8000) libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007fa376376000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa376371000) libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fa376237000) libQt6DBus.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6DBus.so.6 (0x00007fa376165000) libfreetype.so.6 => /lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007fa37609d000) libgthread-2.0.so.0 => /lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007fa376098000) libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007fa375fde000) libicui18n.so.73 => /opt/Qt/6.8.0/gcc_64/lib/libicui18n.so.73 (0x00007fa375c8f000) libicuuc.so.73 => /opt/Qt/6.8.0/gcc_64/lib/libicuuc.so.73 (0x00007fa375a77000) libicudata.so.73 => /opt/Qt/6.8.0/gcc_64/lib/libicudata.so.73 (0x00007fa373be9000) libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007fa373b1a000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fa373b15000) libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007fa373ae2000) libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007fa373ad9000) libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fa373aaf000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fa373a39000) libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007fa3739eb000) libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007fa3739ae000) libbrotlidec.so.1 => /lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007fa3739a0000) libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007fa37399a000) libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fa373992000) libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007fa3738cb000) libbrotlicommon.so.1 => /lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x00007fa3738a6000) libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007fa37388e000) liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fa373863000) liblz4.so.1 => /lib/x86_64-linux-gnu/liblz4.so.1 (0x00007fa373843000) libcap.so.2 => /lib/x86_64-linux-gnu/libcap.so.2 (0x00007fa373838000) libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007fa3736fa000) libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x00007fa3736eb000) libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007fa3736c5000) amonra@styx:~/.vs/DSS/out/build/DeepSkyStackerLive$ cd ../DeepSkyStacker amonra@styx:~/.vs/DSS/out/build/DeepSkyStacker$ ldd DeepSkyStacker linux-vdso.so.1 (0x00007ffcd5164000) libcfitsio.so.10 => /usr/local/lib/libcfitsio.so.10 (0x00007f898db61000) libQt6Widgets.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6Widgets.so.6 (0x00007f898d3b8000) libQt6Gui.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6Gui.so.6 (0x00007f898c928000) libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007f898c8f4000) libOpenGL.so.0 => /lib/x86_64-linux-gnu/libOpenGL.so.0 (0x00007f898c8c8000) libQt6Network.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6Network.so.6 (0x00007f898c6b5000) libQt6Core.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6Core.so.6 (0x00007f898bfde000) libgomp.so.1 => /lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f898bf8a000) libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f898bd1d000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f898bc36000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f898bc12000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f898b9e7000) /lib64/ld-linux-x86-64.so.2 (0x00007f898eb95000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f898b9cb000) libGL.so.1 => /lib/x86_64-linux-gnu/libGL.so.1 (0x00007f898b944000) libxkbcommon.so.0 => /lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007f898b8fd000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f898b8f8000) libEGL.so.1 => /lib/x86_64-linux-gnu/libEGL.so.1 (0x00007f898b8e5000) libfontconfig.so.1 => /lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f898b899000) libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007f898b759000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f898b754000) libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f898b61a000) libQt6DBus.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6DBus.so.6 (0x00007f898b548000) libfreetype.so.6 => /lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f898b480000) libgthread-2.0.so.0 => /lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f898b479000) libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007f898b3c1000) libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007f898b2f2000) libgssapi_krb5.so.2 => /lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f898b29e000) libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f898b28a000) libicui18n.so.73 => /opt/Qt/6.8.0/gcc_64/lib/libicui18n.so.73 (0x00007f898af39000) libicuuc.so.73 => /opt/Qt/6.8.0/gcc_64/lib/libicuuc.so.73 (0x00007f898ad21000) libicudata.so.73 => /opt/Qt/6.8.0/gcc_64/lib/libicudata.so.73 (0x00007f8988e93000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f8988e8e000) libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f8988e5d000) libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f8988e52000) libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f8988e28000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f8988db2000) libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f8988d64000) libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f8988d29000) libbrotlidec.so.1 => /lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007f8988d19000) libkrb5.so.3 => /lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007f8988c4e000) libk5crypto.so.3 => /lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007f8988c1f000) libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f8988c19000) libkrb5support.so.0 => /lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007f8988c0b000) libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007f8988c03000) libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f8988bfb000) libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007f8988b34000) libbrotlicommon.so.1 => /lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x00007f8988b11000) libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007f8988b0a000) libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f8988af0000) liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f8988ac5000) liblz4.so.1 => /lib/x86_64-linux-gnu/liblz4.so.1 (0x00007f8988aa5000) libcap.so.2 => /lib/x86_64-linux-gnu/libcap.so.2 (0x00007f8988a9a000) libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f898895c000) libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x00007f898894f000) libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f8988927000) amonra@styx:~/.vs/DSS/out/build/DeepSkyStacker$Am I missing something blindingly obvious?
-
I've got two executables, both built using CMake. Both specify:
target_link_libraries(${PROJECT_NAME} PRIVATE Qt6::Core Qt6::Gui Qt6::Widgets Qt6::Network Qt6::Charts DeepSkyStackerKernel ZClass )One runs just fine. The other gives me a nastygram:
/home/amonra/.vs/DSS/out/build/DeepSkyStackerLive/DeepSkyStackerLive: error while loading shared libraries: libQt6Network.so.6: cannot open shared object file: No such file or directoryHere's the result of running ldd on the two files:
amonra@styx:~/.vs/DSS/out/build/DeepSkyStackerLive$ ldd DeepSkyStackerLive linux-vdso.so.1 (0x00007ffe91193000) libQt6Charts.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6Charts.so.6 (0x00007fa378953000) libcfitsio.so.10 => /usr/local/lib/libcfitsio.so.10 (0x00007fa378670000) libSmtpMime.so.2 => /usr/local/lib/libSmtpMime.so.2 (0x00007fa37862e000) libQt6Widgets.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6Widgets.so.6 (0x00007fa377e85000) libQt6Gui.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6Gui.so.6 (0x00007fa3773f5000) libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007fa3773bf000) libOpenGL.so.0 => /lib/x86_64-linux-gnu/libOpenGL.so.0 (0x00007fa377393000) libQt6Core.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6Core.so.6 (0x00007fa376cbc000) libgomp.so.1 => /lib/x86_64-linux-gnu/libgomp.so.1 (0x00007fa376c68000) libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fa3769fb000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fa376914000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fa3768ee000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fa3766c5000) /lib64/ld-linux-x86-64.so.2 (0x00007fa379643000) libQt6OpenGLWidgets.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6OpenGLWidgets.so.6 (0x00007fa3766b3000) libQt6OpenGL.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6OpenGL.so.6 (0x00007fa376606000) libGL.so.1 => /lib/x86_64-linux-gnu/libGL.so.1 (0x00007fa37657f000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fa37657a000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007fa37655c000) libQt6Network.so.6 => not found libxkbcommon.so.0 => /lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007fa376515000) libEGL.so.1 => /lib/x86_64-linux-gnu/libEGL.so.1 (0x00007fa376502000) libfontconfig.so.1 => /lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007fa3764b8000) libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007fa376376000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fa376371000) libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007fa376237000) libQt6DBus.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6DBus.so.6 (0x00007fa376165000) libfreetype.so.6 => /lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007fa37609d000) libgthread-2.0.so.0 => /lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007fa376098000) libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007fa375fde000) libicui18n.so.73 => /opt/Qt/6.8.0/gcc_64/lib/libicui18n.so.73 (0x00007fa375c8f000) libicuuc.so.73 => /opt/Qt/6.8.0/gcc_64/lib/libicuuc.so.73 (0x00007fa375a77000) libicudata.so.73 => /opt/Qt/6.8.0/gcc_64/lib/libicudata.so.73 (0x00007fa373be9000) libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007fa373b1a000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007fa373b15000) libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007fa373ae2000) libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007fa373ad9000) libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fa373aaf000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007fa373a39000) libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007fa3739eb000) libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007fa3739ae000) libbrotlidec.so.1 => /lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007fa3739a0000) libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007fa37399a000) libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fa373992000) libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007fa3738cb000) libbrotlicommon.so.1 => /lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x00007fa3738a6000) libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007fa37388e000) liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007fa373863000) liblz4.so.1 => /lib/x86_64-linux-gnu/liblz4.so.1 (0x00007fa373843000) libcap.so.2 => /lib/x86_64-linux-gnu/libcap.so.2 (0x00007fa373838000) libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007fa3736fa000) libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x00007fa3736eb000) libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007fa3736c5000) amonra@styx:~/.vs/DSS/out/build/DeepSkyStackerLive$ cd ../DeepSkyStacker amonra@styx:~/.vs/DSS/out/build/DeepSkyStacker$ ldd DeepSkyStacker linux-vdso.so.1 (0x00007ffcd5164000) libcfitsio.so.10 => /usr/local/lib/libcfitsio.so.10 (0x00007f898db61000) libQt6Widgets.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6Widgets.so.6 (0x00007f898d3b8000) libQt6Gui.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6Gui.so.6 (0x00007f898c928000) libGLX.so.0 => /lib/x86_64-linux-gnu/libGLX.so.0 (0x00007f898c8f4000) libOpenGL.so.0 => /lib/x86_64-linux-gnu/libOpenGL.so.0 (0x00007f898c8c8000) libQt6Network.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6Network.so.6 (0x00007f898c6b5000) libQt6Core.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6Core.so.6 (0x00007f898bfde000) libgomp.so.1 => /lib/x86_64-linux-gnu/libgomp.so.1 (0x00007f898bf8a000) libstdc++.so.6 => /lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007f898bd1d000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007f898bc36000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007f898bc12000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f898b9e7000) /lib64/ld-linux-x86-64.so.2 (0x00007f898eb95000) libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007f898b9cb000) libGL.so.1 => /lib/x86_64-linux-gnu/libGL.so.1 (0x00007f898b944000) libxkbcommon.so.0 => /lib/x86_64-linux-gnu/libxkbcommon.so.0 (0x00007f898b8fd000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f898b8f8000) libEGL.so.1 => /lib/x86_64-linux-gnu/libEGL.so.1 (0x00007f898b8e5000) libfontconfig.so.1 => /lib/x86_64-linux-gnu/libfontconfig.so.1 (0x00007f898b899000) libX11.so.6 => /lib/x86_64-linux-gnu/libX11.so.6 (0x00007f898b759000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f898b754000) libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007f898b61a000) libQt6DBus.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6DBus.so.6 (0x00007f898b548000) libfreetype.so.6 => /lib/x86_64-linux-gnu/libfreetype.so.6 (0x00007f898b480000) libgthread-2.0.so.0 => /lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f898b479000) libGLdispatch.so.0 => /lib/x86_64-linux-gnu/libGLdispatch.so.0 (0x00007f898b3c1000) libzstd.so.1 => /lib/x86_64-linux-gnu/libzstd.so.1 (0x00007f898b2f2000) libgssapi_krb5.so.2 => /lib/x86_64-linux-gnu/libgssapi_krb5.so.2 (0x00007f898b29e000) libresolv.so.2 => /lib/x86_64-linux-gnu/libresolv.so.2 (0x00007f898b28a000) libicui18n.so.73 => /opt/Qt/6.8.0/gcc_64/lib/libicui18n.so.73 (0x00007f898af39000) libicuuc.so.73 => /opt/Qt/6.8.0/gcc_64/lib/libicuuc.so.73 (0x00007f898ad21000) libicudata.so.73 => /opt/Qt/6.8.0/gcc_64/lib/libicudata.so.73 (0x00007f8988e93000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f8988e8e000) libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007f8988e5d000) libuuid.so.1 => /lib/x86_64-linux-gnu/libuuid.so.1 (0x00007f8988e52000) libxcb.so.1 => /lib/x86_64-linux-gnu/libxcb.so.1 (0x00007f8988e28000) libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f8988db2000) libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f8988d64000) libpng16.so.16 => /lib/x86_64-linux-gnu/libpng16.so.16 (0x00007f8988d29000) libbrotlidec.so.1 => /lib/x86_64-linux-gnu/libbrotlidec.so.1 (0x00007f8988d19000) libkrb5.so.3 => /lib/x86_64-linux-gnu/libkrb5.so.3 (0x00007f8988c4e000) libk5crypto.so.3 => /lib/x86_64-linux-gnu/libk5crypto.so.3 (0x00007f8988c1f000) libcom_err.so.2 => /lib/x86_64-linux-gnu/libcom_err.so.2 (0x00007f8988c19000) libkrb5support.so.0 => /lib/x86_64-linux-gnu/libkrb5support.so.0 (0x00007f8988c0b000) libXau.so.6 => /lib/x86_64-linux-gnu/libXau.so.6 (0x00007f8988c03000) libXdmcp.so.6 => /lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007f8988bfb000) libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007f8988b34000) libbrotlicommon.so.1 => /lib/x86_64-linux-gnu/libbrotlicommon.so.1 (0x00007f8988b11000) libkeyutils.so.1 => /lib/x86_64-linux-gnu/libkeyutils.so.1 (0x00007f8988b0a000) libbsd.so.0 => /lib/x86_64-linux-gnu/libbsd.so.0 (0x00007f8988af0000) liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f8988ac5000) liblz4.so.1 => /lib/x86_64-linux-gnu/liblz4.so.1 (0x00007f8988aa5000) libcap.so.2 => /lib/x86_64-linux-gnu/libcap.so.2 (0x00007f8988a9a000) libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007f898895c000) libmd.so.0 => /lib/x86_64-linux-gnu/libmd.so.0 (0x00007f898894f000) libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007f8988927000) amonra@styx:~/.vs/DSS/out/build/DeepSkyStacker$Am I missing something blindingly obvious?
@Perdrix
I don't see "much" what this has to do with cmake. Link time is over, we are now talking about runtime. One of your outputs showslibQt6Network.so.6 => not found, hence the error, while the other showslibQt6Network.so.6 => /opt/Qt/6.8.0/gcc_64/lib/libQt6Network.so.6, so it works. Find out why one of them looks there and not the other. First check their environments (e.g.LD_LIBRARY_PATH) Maybe check the linker lines if you use the-Wl,-rpath=...linker thing for telling it where to look at runtime, see if they differ. -
Well given that they were build using pretty much identical incantations, all under the same top level CMakeLists.txt file ... The environment should be identical as they are both from the same terminal session. I'm in no way skilled in the Linux world.
LD_LIBRARY_PATH is not set in the environment.
I don't specify any linker options for Linux build, should I?
ldconfig -p | grep Qt6
reports nothing
D. -
Well given that they were build using pretty much identical incantations, all under the same top level CMakeLists.txt file ... The environment should be identical as they are both from the same terminal session. I'm in no way skilled in the Linux world.
LD_LIBRARY_PATH is not set in the environment.
I don't specify any linker options for Linux build, should I?
ldconfig -p | grep Qt6
reports nothing
D.I would want to look at the full linker command line issued.
In this case I'm not sure whether rpath is the issue since other libraries are found in
/opt/Qt/6.8.0/gcc_64/lib/.I would save the output of the two
ldds to separate files anddiffthem.In the failing case you have
libQt6OpenGLstuff but in the succeeding case you do not. Is that expected or relevant? Do you have multiplelibQt6Network.so.6files on your system. I would runlddon the existing/opt/Qt/6.8.0/gcc_64/lib/libQt6Network.so.6and look at its dependencies, could they be incompatible where it fails? Doeslddhave an option to tell you why it fails, like where it looks and why it didn't find a file or failed its dependencies?In the working case you are using
OpenGLbut not in the bad case? -
I suspect that this may be a problem of library order - ISTR seeing somewhere that the Linux loader is a bit "quirky" about this. There's only ONE copy of
libQt6Network.soin the system and that's in the expected location of/opt/Qt/6.8.0/gcc_64/lib.Re: OpenGL, I have no clue why that's getting picked up, I don't call any OpenGL stuff from my code. Does Widgets use it under the covers for some things?
The difference is that DeepSkyStacker calls stuff that's in Qt6Network directly, while DeepSkyStackerLive doesn't: The calls to stuff in Qt6Network are made from code in another shared library
libSmtpMime.so.2.Is the loader so "brain dead" that it can't re-traverse the library list. If so how to specify the order of shared libraries when I link the application.
A PS to this: If I want to ship the Qt6 .so files in the same directory as my application do I need to specify
-Wl,-rpath,"\$ORIGIN"?Here's the lines snipped from ninja.build for DeepSkyStackerLive:
LINK_LIBRARIES = -Wl,-rpath,/opt/Qt/6.8.0/gcc_64/lib CMakeFiles/DeepSkyStackerKernel_resources_1.dir/./out/build/.qt/rcc/qrc_DeepSkyStackerKernel_translations_init.cpp.o /opt/Qt/6.8.0/gcc_64/lib/libQt6Charts.so.6.8.0 DeepSkyStackerKernel/libDeepSkyStackerKernel.a ZClass/libZClass.a vcpkg_installed/x64-linux/debug/lib/libboost_container.a vcpkg_installed/x64-linux/debug/lib/libexiv2.a vcpkg_installed/x64-linux/debug/lib/libexpat.a vcpkg_installed/x64-linux/debug/lib/libraw_r.a vcpkg_installed/x64-linux/debug/lib/libtiffd.a vcpkg_installed/x64-linux/debug/lib/libz.a -lcfitsio -lSmtpMime /opt/Qt/6.8.0/gcc_64/lib/libQt6OpenGLWidgets.so.6.8.0 /opt/Qt/6.8.0/gcc_64/lib/libQt6OpenGL.so.6.8.0 /opt/Qt/6.8.0/gcc_64/lib/libQt6Widgets.so.6.8.0 /opt/Qt/6.8.0/gcc_64/lib/libQt6Gui.so.6.8.0 /usr/lib/x86_64-linux-gnu/libGLX.so /usr/lib/x86_64-linux-gnu/libOpenGL.so /opt/Qt/6.8.0/gcc_64/lib/libQt6Network.so.6.8.0 vcpkg_installed/x64-linux/debug/lib/libINIReader.a vcpkg_installed/x64-linux/debug/lib/libinih.a vcpkg_installed/x64-linux/debug/lib/liblcms2.a vcpkg_installed/x64-linux/debug/lib/libjasperd.a vcpkg_installed/x64-linux/debug/lib/libjpeg.a -lm vcpkg_installed/x64-linux/debug/lib/liblzma.a vcpkg_installed/x64-linux/debug/lib/libjpeg.a /opt/Qt/6.8.0/gcc_64/lib/libQt6Core.so.6.8.0 /usr/lib/gcc/x86_64-linux-gnu/13/libgomp.so /usr/lib/x86_64-linux-gnu/libpthread.a -Wl,-rpath-link,/opt/Qt/6.8.0/gcc_64/libThe equivalent stuff for DeepSkyStacker reads:
LINK_LIBRARIES = -Wl,-rpath,/opt/Qt/6.8.0/gcc_64/lib CMakeFiles/DeepSkyStackerKernel_resources_1.dir/./out/build/.qt/rcc/qrc_DeepSkyStackerKernel_translations_init.cpp.o DeepSkyStackerKernel/libDeepSkyStackerKernel.a ZClass/libZClass.a vcpkg_installed/x64-linux/debug/lib/libboost_container.a vcpkg_installed/x64-linux/debug/lib/libexiv2.a vcpkg_installed/x64-linux/debug/lib/libexpat.a vcpkg_installed/x64-linux/debug/lib/libraw_r.a vcpkg_installed/x64-linux/debug/lib/libtiffd.a vcpkg_installed/x64-linux/debug/lib/libz.a -lcfitsio /opt/Qt/6.8.0/gcc_64/lib/libQt6Widgets.so.6.8.0 /opt/Qt/6.8.0/gcc_64/lib/libQt6Gui.so.6.8.0 /usr/lib/x86_64-linux-gnu/libGLX.so /usr/lib/x86_64-linux-gnu/libOpenGL.so /opt/Qt/6.8.0/gcc_64/lib/libQt6Network.so.6.8.0 vcpkg_installed/x64-linux/debug/lib/libINIReader.a vcpkg_installed/x64-linux/debug/lib/libinih.a vcpkg_installed/x64-linux/debug/lib/liblcms2.a vcpkg_installed/x64-linux/debug/lib/libjasperd.a vcpkg_installed/x64-linux/debug/lib/libjpeg.a -lm vcpkg_installed/x64-linux/debug/lib/liblzma.a vcpkg_installed/x64-linux/debug/lib/libjpeg.a /opt/Qt/6.8.0/gcc_64/lib/libQt6Core.so.6.8.0 /usr/lib/gcc/x86_64-linux-gnu/13/libgomp.so /usr/lib/x86_64-linux-gnu/libpthread.a -Wl,-rpath-link,/opt/Qt/6.8.0/gcc_64/libHmmm...
LD_DEBUG=libs ./DeepSkyStackerLive 9693: find library=libQt6Charts.so.6 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib/glibc-hwcaps/x86-64-v3:/opt/Qt/6.8.0/gcc_64/lib/glibc-hwcaps/x86-64-v2:/opt/Qt/6.8.0/gcc_64/lib/tls/haswell/x86_64:/opt/Qt/6.8.0/gcc_64/lib/tls/haswell:/opt/Qt/6.8.0/gcc_64/lib/tls/x86_64:/opt/Qt/6.8.0/gcc_64/lib/tls:/opt/Qt/6.8.0/gcc_64/lib/haswell/x86_64:/opt/Qt/6.8.0/gcc_64/lib/haswell:/opt/Qt/6.8.0/gcc_64/lib/x86_64:/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/glibc-hwcaps/x86-64-v3/libQt6Charts.so.6 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/glibc-hwcaps/x86-64-v2/libQt6Charts.so.6 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/tls/haswell/x86_64/libQt6Charts.so.6 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/tls/haswell/libQt6Charts.so.6 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/tls/x86_64/libQt6Charts.so.6 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/tls/libQt6Charts.so.6 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/haswell/x86_64/libQt6Charts.so.6 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/haswell/libQt6Charts.so.6 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/x86_64/libQt6Charts.so.6 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libQt6Charts.so.6 9693: 9693: find library=libcfitsio.so.10 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libcfitsio.so.10 9693: search cache=/etc/ld.so.cache 9693: trying file=/usr/local/lib/libcfitsio.so.10 9693: 9693: find library=libSmtpMime.so.2 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libSmtpMime.so.2 9693: search cache=/etc/ld.so.cache 9693: trying file=/usr/local/lib/libSmtpMime.so.2 9693: 9693: find library=libQt6Widgets.so.6 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libQt6Widgets.so.6 9693: 9693: find library=libQt6Gui.so.6 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libQt6Gui.so.6 9693: 9693: find library=libGLX.so.0 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libGLX.so.0 9693: search cache=/etc/ld.so.cache 9693: trying file=/lib/x86_64-linux-gnu/libGLX.so.0 9693: 9693: find library=libOpenGL.so.0 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libOpenGL.so.0 9693: search cache=/etc/ld.so.cache 9693: trying file=/lib/x86_64-linux-gnu/libOpenGL.so.0 9693: 9693: find library=libQt6Core.so.6 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libQt6Core.so.6 9693: 9693: find library=libgomp.so.1 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libgomp.so.1 9693: search cache=/etc/ld.so.cache 9693: trying file=/lib/x86_64-linux-gnu/libgomp.so.1 9693: 9693: find library=libstdc++.so.6 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libstdc++.so.6 9693: search cache=/etc/ld.so.cache 9693: trying file=/lib/x86_64-linux-gnu/libstdc++.so.6 9693: 9693: find library=libm.so.6 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libm.so.6 9693: search cache=/etc/ld.so.cache 9693: trying file=/lib/x86_64-linux-gnu/libm.so.6 9693: 9693: find library=libgcc_s.so.1 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libgcc_s.so.1 9693: search cache=/etc/ld.so.cache 9693: trying file=/lib/x86_64-linux-gnu/libgcc_s.so.1 9693: 9693: find library=libc.so.6 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libc.so.6 9693: search cache=/etc/ld.so.cache 9693: trying file=/lib/x86_64-linux-gnu/libc.so.6 9693: 9693: find library=libQt6OpenGLWidgets.so.6 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libQt6OpenGLWidgets.so.6 9693: 9693: find library=libQt6OpenGL.so.6 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libQt6OpenGL.so.6 9693: 9693: find library=libGL.so.1 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libGL.so.1 9693: search cache=/etc/ld.so.cache 9693: trying file=/lib/x86_64-linux-gnu/libGL.so.1 9693: 9693: find library=libpthread.so.0 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libpthread.so.0 9693: search cache=/etc/ld.so.cache 9693: trying file=/lib/x86_64-linux-gnu/libpthread.so.0 9693: 9693: find library=libz.so.1 [0]; searching 9693: search cache=/etc/ld.so.cache 9693: trying file=/lib/x86_64-linux-gnu/libz.so.1 9693: 9693: find library=libQt6Network.so.6 [0]; searching 9693: search cache=/etc/ld.so.cache 9693: search path=/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v3:/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2:/lib/x86_64-linux-gnu/tls/haswell/x86_64:/lib/x86_64-linux-gnu/tls/haswell:/lib/x86_64-linux-gnu/tls/x86_64:/lib/x86_64-linux-gnu/tls:/lib/x86_64-linux-gnu/haswell/x86_64:/lib/x86_64-linux-gnu/haswell:/lib/x86_64-linux-gnu/x86_64:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v3:/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2:/usr/lib/x86_64-linux-gnu/tls/haswell/x86_64:/usr/lib/x86_64-linux-gnu/tls/haswell:/usr/lib/x86_64-linux-gnu/tls/x86_64:/usr/lib/x86_64-linux-gnu/tls:/usr/lib/x86_64-linux-gnu/haswell/x86_64:/usr/lib/x86_64-linux-gnu/haswell:/usr/lib/x86_64-linux-gnu/x86_64:/usr/lib/x86_64-linux-gnu:/lib/glibc-hwcaps/x86-64-v3:/lib/glibc-hwcaps/x86-64-v2:/lib/tls/haswell/x86_64:/lib/tls/haswell:/lib/tls/x86_64:/lib/tls:/lib/haswell/x86_64:/lib/haswell:/lib/x86_64:/lib:/usr/lib/glibc-hwcaps/x86-64-v3:/usr/lib/glibc-hwcaps/x86-64-v2:/usr/lib/tls/haswell/x86_64:/usr/lib/tls/haswell:/usr/lib/tls/x86_64:/usr/lib/tls:/usr/lib/haswell/x86_64:/usr/lib/haswell:/usr/lib/x86_64:/usr/lib (system search path) 9693: trying file=/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v3/libQt6Network.so.6 9693: trying file=/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2/libQt6Network.so.6 9693: trying file=/lib/x86_64-linux-gnu/tls/haswell/x86_64/libQt6Network.so.6 9693: trying file=/lib/x86_64-linux-gnu/tls/haswell/libQt6Network.so.6 9693: trying file=/lib/x86_64-linux-gnu/tls/x86_64/libQt6Network.so.6 9693: trying file=/lib/x86_64-linux-gnu/tls/libQt6Network.so.6 9693: trying file=/lib/x86_64-linux-gnu/haswell/x86_64/libQt6Network.so.6 9693: trying file=/lib/x86_64-linux-gnu/haswell/libQt6Network.so.6 9693: trying file=/lib/x86_64-linux-gnu/x86_64/libQt6Network.so.6 9693: trying file=/lib/x86_64-linux-gnu/libQt6Network.so.6 9693: trying file=/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v3/libQt6Network.so.6 9693: trying file=/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2/libQt6Network.so.6 9693: trying file=/usr/lib/x86_64-linux-gnu/tls/haswell/x86_64/libQt6Network.so.6 9693: trying file=/usr/lib/x86_64-linux-gnu/tls/haswell/libQt6Network.so.6 9693: trying file=/usr/lib/x86_64-linux-gnu/tls/x86_64/libQt6Network.so.6 9693: trying file=/usr/lib/x86_64-linux-gnu/tls/libQt6Network.so.6 9693: trying file=/usr/lib/x86_64-linux-gnu/haswell/x86_64/libQt6Network.so.6 9693: trying file=/usr/lib/x86_64-linux-gnu/haswell/libQt6Network.so.6 9693: trying file=/usr/lib/x86_64-linux-gnu/x86_64/libQt6Network.so.6 9693: trying file=/usr/lib/x86_64-linux-gnu/libQt6Network.so.6 9693: trying file=/lib/glibc-hwcaps/x86-64-v3/libQt6Network.so.6 9693: trying file=/lib/glibc-hwcaps/x86-64-v2/libQt6Network.so.6 9693: trying file=/lib/tls/haswell/x86_64/libQt6Network.so.6 9693: trying file=/lib/tls/haswell/libQt6Network.so.6 9693: trying file=/lib/tls/x86_64/libQt6Network.so.6 9693: trying file=/lib/tls/libQt6Network.so.6 9693: trying file=/lib/haswell/x86_64/libQt6Network.so.6 9693: trying file=/lib/haswell/libQt6Network.so.6 9693: trying file=/lib/x86_64/libQt6Network.so.6 9693: trying file=/lib/libQt6Network.so.6 9693: trying file=/usr/lib/glibc-hwcaps/x86-64-v3/libQt6Network.so.6 9693: trying file=/usr/lib/glibc-hwcaps/x86-64-v2/libQt6Network.so.6 9693: trying file=/usr/lib/tls/haswell/x86_64/libQt6Network.so.6 9693: trying file=/usr/lib/tls/haswell/libQt6Network.so.6 9693: trying file=/usr/lib/tls/x86_64/libQt6Network.so.6 9693: trying file=/usr/lib/tls/libQt6Network.so.6 9693: trying file=/usr/lib/haswell/x86_64/libQt6Network.so.6 9693: trying file=/usr/lib/haswell/libQt6Network.so.6 9693: trying file=/usr/lib/x86_64/libQt6Network.so.6 9693: trying file=/usr/lib/libQt6Network.so.6 9693: ./DeepSkyStackerLive: error while loading shared libraries: libQt6Network.so.6: cannot open shared object file: No such file or directory amonra@styx:~/.vs/DSS/out/build/DeepSkyStackerLive$Thanks, David
-
I suspect that this may be a problem of library order - ISTR seeing somewhere that the Linux loader is a bit "quirky" about this. There's only ONE copy of
libQt6Network.soin the system and that's in the expected location of/opt/Qt/6.8.0/gcc_64/lib.Re: OpenGL, I have no clue why that's getting picked up, I don't call any OpenGL stuff from my code. Does Widgets use it under the covers for some things?
The difference is that DeepSkyStacker calls stuff that's in Qt6Network directly, while DeepSkyStackerLive doesn't: The calls to stuff in Qt6Network are made from code in another shared library
libSmtpMime.so.2.Is the loader so "brain dead" that it can't re-traverse the library list. If so how to specify the order of shared libraries when I link the application.
A PS to this: If I want to ship the Qt6 .so files in the same directory as my application do I need to specify
-Wl,-rpath,"\$ORIGIN"?Here's the lines snipped from ninja.build for DeepSkyStackerLive:
LINK_LIBRARIES = -Wl,-rpath,/opt/Qt/6.8.0/gcc_64/lib CMakeFiles/DeepSkyStackerKernel_resources_1.dir/./out/build/.qt/rcc/qrc_DeepSkyStackerKernel_translations_init.cpp.o /opt/Qt/6.8.0/gcc_64/lib/libQt6Charts.so.6.8.0 DeepSkyStackerKernel/libDeepSkyStackerKernel.a ZClass/libZClass.a vcpkg_installed/x64-linux/debug/lib/libboost_container.a vcpkg_installed/x64-linux/debug/lib/libexiv2.a vcpkg_installed/x64-linux/debug/lib/libexpat.a vcpkg_installed/x64-linux/debug/lib/libraw_r.a vcpkg_installed/x64-linux/debug/lib/libtiffd.a vcpkg_installed/x64-linux/debug/lib/libz.a -lcfitsio -lSmtpMime /opt/Qt/6.8.0/gcc_64/lib/libQt6OpenGLWidgets.so.6.8.0 /opt/Qt/6.8.0/gcc_64/lib/libQt6OpenGL.so.6.8.0 /opt/Qt/6.8.0/gcc_64/lib/libQt6Widgets.so.6.8.0 /opt/Qt/6.8.0/gcc_64/lib/libQt6Gui.so.6.8.0 /usr/lib/x86_64-linux-gnu/libGLX.so /usr/lib/x86_64-linux-gnu/libOpenGL.so /opt/Qt/6.8.0/gcc_64/lib/libQt6Network.so.6.8.0 vcpkg_installed/x64-linux/debug/lib/libINIReader.a vcpkg_installed/x64-linux/debug/lib/libinih.a vcpkg_installed/x64-linux/debug/lib/liblcms2.a vcpkg_installed/x64-linux/debug/lib/libjasperd.a vcpkg_installed/x64-linux/debug/lib/libjpeg.a -lm vcpkg_installed/x64-linux/debug/lib/liblzma.a vcpkg_installed/x64-linux/debug/lib/libjpeg.a /opt/Qt/6.8.0/gcc_64/lib/libQt6Core.so.6.8.0 /usr/lib/gcc/x86_64-linux-gnu/13/libgomp.so /usr/lib/x86_64-linux-gnu/libpthread.a -Wl,-rpath-link,/opt/Qt/6.8.0/gcc_64/libThe equivalent stuff for DeepSkyStacker reads:
LINK_LIBRARIES = -Wl,-rpath,/opt/Qt/6.8.0/gcc_64/lib CMakeFiles/DeepSkyStackerKernel_resources_1.dir/./out/build/.qt/rcc/qrc_DeepSkyStackerKernel_translations_init.cpp.o DeepSkyStackerKernel/libDeepSkyStackerKernel.a ZClass/libZClass.a vcpkg_installed/x64-linux/debug/lib/libboost_container.a vcpkg_installed/x64-linux/debug/lib/libexiv2.a vcpkg_installed/x64-linux/debug/lib/libexpat.a vcpkg_installed/x64-linux/debug/lib/libraw_r.a vcpkg_installed/x64-linux/debug/lib/libtiffd.a vcpkg_installed/x64-linux/debug/lib/libz.a -lcfitsio /opt/Qt/6.8.0/gcc_64/lib/libQt6Widgets.so.6.8.0 /opt/Qt/6.8.0/gcc_64/lib/libQt6Gui.so.6.8.0 /usr/lib/x86_64-linux-gnu/libGLX.so /usr/lib/x86_64-linux-gnu/libOpenGL.so /opt/Qt/6.8.0/gcc_64/lib/libQt6Network.so.6.8.0 vcpkg_installed/x64-linux/debug/lib/libINIReader.a vcpkg_installed/x64-linux/debug/lib/libinih.a vcpkg_installed/x64-linux/debug/lib/liblcms2.a vcpkg_installed/x64-linux/debug/lib/libjasperd.a vcpkg_installed/x64-linux/debug/lib/libjpeg.a -lm vcpkg_installed/x64-linux/debug/lib/liblzma.a vcpkg_installed/x64-linux/debug/lib/libjpeg.a /opt/Qt/6.8.0/gcc_64/lib/libQt6Core.so.6.8.0 /usr/lib/gcc/x86_64-linux-gnu/13/libgomp.so /usr/lib/x86_64-linux-gnu/libpthread.a -Wl,-rpath-link,/opt/Qt/6.8.0/gcc_64/libHmmm...
LD_DEBUG=libs ./DeepSkyStackerLive 9693: find library=libQt6Charts.so.6 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib/glibc-hwcaps/x86-64-v3:/opt/Qt/6.8.0/gcc_64/lib/glibc-hwcaps/x86-64-v2:/opt/Qt/6.8.0/gcc_64/lib/tls/haswell/x86_64:/opt/Qt/6.8.0/gcc_64/lib/tls/haswell:/opt/Qt/6.8.0/gcc_64/lib/tls/x86_64:/opt/Qt/6.8.0/gcc_64/lib/tls:/opt/Qt/6.8.0/gcc_64/lib/haswell/x86_64:/opt/Qt/6.8.0/gcc_64/lib/haswell:/opt/Qt/6.8.0/gcc_64/lib/x86_64:/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/glibc-hwcaps/x86-64-v3/libQt6Charts.so.6 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/glibc-hwcaps/x86-64-v2/libQt6Charts.so.6 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/tls/haswell/x86_64/libQt6Charts.so.6 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/tls/haswell/libQt6Charts.so.6 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/tls/x86_64/libQt6Charts.so.6 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/tls/libQt6Charts.so.6 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/haswell/x86_64/libQt6Charts.so.6 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/haswell/libQt6Charts.so.6 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/x86_64/libQt6Charts.so.6 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libQt6Charts.so.6 9693: 9693: find library=libcfitsio.so.10 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libcfitsio.so.10 9693: search cache=/etc/ld.so.cache 9693: trying file=/usr/local/lib/libcfitsio.so.10 9693: 9693: find library=libSmtpMime.so.2 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libSmtpMime.so.2 9693: search cache=/etc/ld.so.cache 9693: trying file=/usr/local/lib/libSmtpMime.so.2 9693: 9693: find library=libQt6Widgets.so.6 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libQt6Widgets.so.6 9693: 9693: find library=libQt6Gui.so.6 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libQt6Gui.so.6 9693: 9693: find library=libGLX.so.0 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libGLX.so.0 9693: search cache=/etc/ld.so.cache 9693: trying file=/lib/x86_64-linux-gnu/libGLX.so.0 9693: 9693: find library=libOpenGL.so.0 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libOpenGL.so.0 9693: search cache=/etc/ld.so.cache 9693: trying file=/lib/x86_64-linux-gnu/libOpenGL.so.0 9693: 9693: find library=libQt6Core.so.6 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libQt6Core.so.6 9693: 9693: find library=libgomp.so.1 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libgomp.so.1 9693: search cache=/etc/ld.so.cache 9693: trying file=/lib/x86_64-linux-gnu/libgomp.so.1 9693: 9693: find library=libstdc++.so.6 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libstdc++.so.6 9693: search cache=/etc/ld.so.cache 9693: trying file=/lib/x86_64-linux-gnu/libstdc++.so.6 9693: 9693: find library=libm.so.6 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libm.so.6 9693: search cache=/etc/ld.so.cache 9693: trying file=/lib/x86_64-linux-gnu/libm.so.6 9693: 9693: find library=libgcc_s.so.1 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libgcc_s.so.1 9693: search cache=/etc/ld.so.cache 9693: trying file=/lib/x86_64-linux-gnu/libgcc_s.so.1 9693: 9693: find library=libc.so.6 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libc.so.6 9693: search cache=/etc/ld.so.cache 9693: trying file=/lib/x86_64-linux-gnu/libc.so.6 9693: 9693: find library=libQt6OpenGLWidgets.so.6 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libQt6OpenGLWidgets.so.6 9693: 9693: find library=libQt6OpenGL.so.6 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libQt6OpenGL.so.6 9693: 9693: find library=libGL.so.1 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libGL.so.1 9693: search cache=/etc/ld.so.cache 9693: trying file=/lib/x86_64-linux-gnu/libGL.so.1 9693: 9693: find library=libpthread.so.0 [0]; searching 9693: search path=/opt/Qt/6.8.0/gcc_64/lib (RUNPATH from file ./DeepSkyStackerLive) 9693: trying file=/opt/Qt/6.8.0/gcc_64/lib/libpthread.so.0 9693: search cache=/etc/ld.so.cache 9693: trying file=/lib/x86_64-linux-gnu/libpthread.so.0 9693: 9693: find library=libz.so.1 [0]; searching 9693: search cache=/etc/ld.so.cache 9693: trying file=/lib/x86_64-linux-gnu/libz.so.1 9693: 9693: find library=libQt6Network.so.6 [0]; searching 9693: search cache=/etc/ld.so.cache 9693: search path=/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v3:/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2:/lib/x86_64-linux-gnu/tls/haswell/x86_64:/lib/x86_64-linux-gnu/tls/haswell:/lib/x86_64-linux-gnu/tls/x86_64:/lib/x86_64-linux-gnu/tls:/lib/x86_64-linux-gnu/haswell/x86_64:/lib/x86_64-linux-gnu/haswell:/lib/x86_64-linux-gnu/x86_64:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v3:/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2:/usr/lib/x86_64-linux-gnu/tls/haswell/x86_64:/usr/lib/x86_64-linux-gnu/tls/haswell:/usr/lib/x86_64-linux-gnu/tls/x86_64:/usr/lib/x86_64-linux-gnu/tls:/usr/lib/x86_64-linux-gnu/haswell/x86_64:/usr/lib/x86_64-linux-gnu/haswell:/usr/lib/x86_64-linux-gnu/x86_64:/usr/lib/x86_64-linux-gnu:/lib/glibc-hwcaps/x86-64-v3:/lib/glibc-hwcaps/x86-64-v2:/lib/tls/haswell/x86_64:/lib/tls/haswell:/lib/tls/x86_64:/lib/tls:/lib/haswell/x86_64:/lib/haswell:/lib/x86_64:/lib:/usr/lib/glibc-hwcaps/x86-64-v3:/usr/lib/glibc-hwcaps/x86-64-v2:/usr/lib/tls/haswell/x86_64:/usr/lib/tls/haswell:/usr/lib/tls/x86_64:/usr/lib/tls:/usr/lib/haswell/x86_64:/usr/lib/haswell:/usr/lib/x86_64:/usr/lib (system search path) 9693: trying file=/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v3/libQt6Network.so.6 9693: trying file=/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2/libQt6Network.so.6 9693: trying file=/lib/x86_64-linux-gnu/tls/haswell/x86_64/libQt6Network.so.6 9693: trying file=/lib/x86_64-linux-gnu/tls/haswell/libQt6Network.so.6 9693: trying file=/lib/x86_64-linux-gnu/tls/x86_64/libQt6Network.so.6 9693: trying file=/lib/x86_64-linux-gnu/tls/libQt6Network.so.6 9693: trying file=/lib/x86_64-linux-gnu/haswell/x86_64/libQt6Network.so.6 9693: trying file=/lib/x86_64-linux-gnu/haswell/libQt6Network.so.6 9693: trying file=/lib/x86_64-linux-gnu/x86_64/libQt6Network.so.6 9693: trying file=/lib/x86_64-linux-gnu/libQt6Network.so.6 9693: trying file=/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v3/libQt6Network.so.6 9693: trying file=/usr/lib/x86_64-linux-gnu/glibc-hwcaps/x86-64-v2/libQt6Network.so.6 9693: trying file=/usr/lib/x86_64-linux-gnu/tls/haswell/x86_64/libQt6Network.so.6 9693: trying file=/usr/lib/x86_64-linux-gnu/tls/haswell/libQt6Network.so.6 9693: trying file=/usr/lib/x86_64-linux-gnu/tls/x86_64/libQt6Network.so.6 9693: trying file=/usr/lib/x86_64-linux-gnu/tls/libQt6Network.so.6 9693: trying file=/usr/lib/x86_64-linux-gnu/haswell/x86_64/libQt6Network.so.6 9693: trying file=/usr/lib/x86_64-linux-gnu/haswell/libQt6Network.so.6 9693: trying file=/usr/lib/x86_64-linux-gnu/x86_64/libQt6Network.so.6 9693: trying file=/usr/lib/x86_64-linux-gnu/libQt6Network.so.6 9693: trying file=/lib/glibc-hwcaps/x86-64-v3/libQt6Network.so.6 9693: trying file=/lib/glibc-hwcaps/x86-64-v2/libQt6Network.so.6 9693: trying file=/lib/tls/haswell/x86_64/libQt6Network.so.6 9693: trying file=/lib/tls/haswell/libQt6Network.so.6 9693: trying file=/lib/tls/x86_64/libQt6Network.so.6 9693: trying file=/lib/tls/libQt6Network.so.6 9693: trying file=/lib/haswell/x86_64/libQt6Network.so.6 9693: trying file=/lib/haswell/libQt6Network.so.6 9693: trying file=/lib/x86_64/libQt6Network.so.6 9693: trying file=/lib/libQt6Network.so.6 9693: trying file=/usr/lib/glibc-hwcaps/x86-64-v3/libQt6Network.so.6 9693: trying file=/usr/lib/glibc-hwcaps/x86-64-v2/libQt6Network.so.6 9693: trying file=/usr/lib/tls/haswell/x86_64/libQt6Network.so.6 9693: trying file=/usr/lib/tls/haswell/libQt6Network.so.6 9693: trying file=/usr/lib/tls/x86_64/libQt6Network.so.6 9693: trying file=/usr/lib/tls/libQt6Network.so.6 9693: trying file=/usr/lib/haswell/x86_64/libQt6Network.so.6 9693: trying file=/usr/lib/haswell/libQt6Network.so.6 9693: trying file=/usr/lib/x86_64/libQt6Network.so.6 9693: trying file=/usr/lib/libQt6Network.so.6 9693: ./DeepSkyStackerLive: error while loading shared libraries: libQt6Network.so.6: cannot open shared object file: No such file or directory amonra@styx:~/.vs/DSS/out/build/DeepSkyStackerLive$Thanks, David
@Perdrix said in Problem with linking to libQt6Network.so.6:
The difference is that DeepSkyStacker calls stuff that's in Qt6Network directly, while DeepSkyStackerLive doesn't: The calls to stuff in Qt6Network are made from code in another shared library libSmtpMime.so.2.
Hmmm...
I'm not sure what your "Hmmm" means?! From the output I see that most libraries are sought in
search path=/opt/Qt/6.8.0/gcc_64/libviaRUNPATH. ButlibQt6Network.so.6(andlibz.so.1) is not. That is the root of your error. Presumably when you use it it respects your-Wl,-rpath. But when it is wanted fromlibSmtpMime.so.2it is not, presumably because that was not linked with the same-Wl,-rpath. If you compare against the case where it does work, called for from your own code, I presume you would see it using the sameRUNPATHas the other libraries.So what is
libSmtpMime.so.2, and why does it want a Qt library anyway? There is basically nothing about it on Google, so I can only guess it's a library internal to DeepSkyStacker? Did you build that, so that you in control of its-Wl,-rpath? Does it require "deploying"?For now you could
ln -s /opt/Qt/6.8.0/gcc_64/lib/libQt6Network.soto either the executable directory or whereverlibSmtpMime.so.2is and verify that makes it work.I don't know what you are supposed to do or what this tells us. I don't think Linux (unlike Windows) searches the executable or current directories for shared libraries, but I may be wrong. (I wonder what
linuxdeployqtdoes about this?) Either-Wl,-rpath,"\$ORIGIN"or a "wrapper" at runtime for the executable which setsLD_LIBRARY_PATH. -
SmtpMime.so is Qt related, see: https://github.com/bluetiger9/SmtpClient-for-Qt/ and builds as a .so.
If I remove the calls in my code that use it by ifdef-ing them away, my code links and loads OK.
-
SmtpMime.so is Qt related, see: https://github.com/bluetiger9/SmtpClient-for-Qt/ and builds as a .so.
If I remove the calls in my code that use it by ifdef-ing them away, my code links and loads OK.
@Perdrix
Then my guess is that if maybelibSmtpMime.sois built with-Wl,-rpath=to findlibQt6Network.so.6like your one that works does it would find it at runtime? I think when you build it behoves you to ensure your code and any libraries it uses use the same and a consistent set of where to find libraries. The SmtpMime stuff looks like it was written a long time ago, it won't know (during its build) about/opt/Qt/6.8.0/gcc_64/lib/that you use for your part of the code? -
Quoting from their CMakeLists.txt file:
find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Core REQUIRED) find_package(Qt${QT_VERSION_MAJOR} COMPONENTS Network REQUIRED) qt_add_library(${PROJECT_NAME} SHARED emailaddress.cpp : omitted ) target_link_libraries(${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Core) target_link_libraries(${PROJECT_NAME} PRIVATE Qt${QT_VERSION_MAJOR}::Network) set(CMAKE_SKIP_BUILD_RPATH FALSE) set(CMAKE_BUILD_WITH_INSTALL_RPATH TRUE) set(CMAKE_INSTALL_RPATH “${ORIGIN}”)I built it using:
cmake -B ./build -G Ninja -DQT_VERSION_MAJOR=6 -DCMAKE_INSTALL_PREFIX:STRING="/usr/local" -DCMAKE_MODULE_PATH:STRING="/usr/share/cmake-3.30/Modules" -DCMAKE_PREFIX_PATH:STRING="/opt/Qt/6.8.0/gcc_64" cd build ninja sudo ninja installit may behove me etc. but as I said I'm not a Linux guru - more a beginner.
This is clearly rpath related but way beyond my current understanding. Maybe I should ask the CMake folks how to work round this problem.
D.