2

I am using Qt Creator to develop and run an application on Linux KDE neon.

My application suddenly refuses to open some URLs, a function that properly worked before. I didn't change anything so I guess some KDE neon updates broke it.

When calling that function I get this debug output:

kde-open5: /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/x86_64-linux-gnu/libKF5KIOWidgets.so.5)
kde-open5: /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/x86_64-linux-gnu/libKF5KIOCore.so.5)
kde-open5: /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/x86_64-linux-gnu/libKF5I18n.so.5)
kde-open5: /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/x86_64-linux-gnu/libKF5CoreAddons.so.5)
kde-open5: /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/x86_64-linux-gnu/libKF5JobWidgets.so.5)
kde-open5: /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/x86_64-linux-gnu/libKF5Service.so.5)
kde-open5: /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/x86_64-linux-gnu/libKF5Completion.so.5)
kde-open5: /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/x86_64-linux-gnu/libKF5IconThemes.so.5)
kde-open5: /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/x86_64-linux-gnu/libKF5WindowSystem.so.5)
kde-open5: /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/x86_64-linux-gnu/libKF5ConfigWidgets.so.5)
kde-open5: /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/x86_64-linux-gnu/libKF5WidgetsAddons.so.5)
kde-open5: /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/x86_64-linux-gnu/libKF5ConfigGui.so.5)
kde-open5: /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/x86_64-linux-gnu/libKF5ConfigCore.so.5)
kde-open5: /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/x86_64-linux-gnu/libKF5DBusAddons.so.5)
kde-open5: /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/x86_64-linux-gnu/libKF5Auth.so.5)
kde-open5: /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/x86_64-linux-gnu/libKF5Archive.so.5)
kde-open5: /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/x86_64-linux-gnu/libKF5ItemViews.so.5)
kde-open5: /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/x86_64-linux-gnu/libKF5Codecs.so.5)
kde-open5: /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Core.so.5: version `Qt_5.11' not found (required by /usr/lib/x86_64-linux-gnu/libKF5GuiAddons.so.5)

AFAIK the two paths mentioned above are concurrent to each other because one is created by the distribution and one by Qt Creator.

The solution should be using -rpath when linking the application. My application is built with the following command line:

gcc -Wl,-rpath,/home/<user>/Qt/5.10.0/gcc_64/lib .....

Looks fine to me. Also the following is passed to gcc:

-L/home/<user>/Qt/5.10.0/gcc_64/lib

What is missing here? Why does my application depend from Qt 5.11 libraries while the build process sets the correct Qt 5.10 path?

UPDATE, this is what ldd says about my executable.

linux-vdso.so.1 =>  (0x00007ffd08b1e000)
libQt5Widgets.so.5 => /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Widgets.so.5 (0x00007faa1849b000)
libQt5Gui.so.5 => /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Gui.so.5 (0x00007faa17cb3000)
libQt5DBus.so.5 => /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5DBus.so.5 (0x00007faa17a23000)
libQt5Xml.so.5 => /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Xml.so.5 (0x00007faa177e3000)
libQt5Script.so.5 => /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Script.so.5 (0x00007faa1735b000)
libQt5XmlPatterns.so.5 => /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5XmlPatterns.so.5 (0x00007faa16d83000)
libQt5Network.so.5 => /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Network.so.5 (0x00007faa169eb000)
libQt5Core.so.5 => /home/<user>/Qt/5.10.0/gcc_64/lib/libQt5Core.so.5 (0x00007faa1629b000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007faa1607b000)
libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007faa15cf3000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007faa159e3000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007faa157cb000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007faa153fb000)
/lib64/ld-linux-x86-64.so.2 (0x00007faa18cdb000)
libGL.so.1 => /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 (0x00007faa15183000)
libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x00007faa14f63000)
libdbus-1.so.3 => /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007faa14d13000)
libicui18n.so.56 => /home/<user>/Qt/5.10.0/gcc_64/lib/libicui18n.so.56 (0x00007faa14873000)
libicuuc.so.56 => /home/<user>/Qt/5.10.0/gcc_64/lib/libicuuc.so.56 (0x00007faa144bb000)
libicudata.so.56 => /home/<user>/Qt/5.10.0/gcc_64/lib/libicudata.so.56 (0x00007faa12ad3000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007faa128cb000)
libgthread-2.0.so.0 => /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007faa126c3000)
libglib-2.0.so.0 => /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007faa123ab000)
libexpat.so.1 => /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007faa1217b000)
libxcb-dri3.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0 (0x00007faa11f73000)
libxcb-present.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-present.so.0 (0x00007faa11d6b000)
libxcb-sync.so.1 => /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007faa11b63000)
libxshmfence.so.1 => /usr/lib/x86_64-linux-gnu/libxshmfence.so.1 (0x00007faa1195b000)
libglapi.so.0 => /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007faa1172b000)
libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007faa11513000)
libXdamage.so.1 => /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007faa1130b000)
libXfixes.so.3 => /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007faa11103000)
libX11-xcb.so.1 => /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007faa10efb000)
libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007faa10bbb000)
libxcb-glx.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007faa1099b000)
libxcb-dri2.so.0 => /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007faa10793000)
libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007faa1056b000)
libXxf86vm.so.1 => /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007faa10363000)
libdrm.so.2 => /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007faa1014b000)
libsystemd.so.0 => /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007faa18e43000)
libpcre.so.3 => /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007faa0fedb000)
libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007faa0fcd3000)
libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007faa0facb000)
libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007faa0f8a3000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007faa0f69b000)
liblzma.so.5 => /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007faa0f473000)
libgcrypt.so.20 => /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007faa0f18b000)
libgpg-error.so.0 => /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007faa0ef73000)

UPDATE2, /sbin/ldconfig -v 2>/dev/null | grep -v ^$'\t' results in:

/usr/lib/x86_64-linux-gnu/libfakeroot:
/lib/i386-linux-gnu:
/usr/lib/i386-linux-gnu:
/usr/lib/i386-linux-gnu/mesa:
/usr/local/lib:
/lib/x86_64-linux-gnu:
/usr/lib/x86_64-linux-gnu:
/usr/lib/x86_64-linux-gnu/mesa-egl:
/usr/lib/x86_64-linux-gnu/mesa:
/lib:
/usr/lib:
/usr/lib/i386-linux-gnu/sse2: (hwcap: 0x0000000004000000)

echo $LD_LIBRARY_PATH prints nothing.

Silicomancer
  • 8,604
  • 10
  • 63
  • 130

1 Answers1

1

-rpath hardcodes the run-time library search path in an executable file or library. It does not affect linker search paths, so your application is linked with the system Qt libraries. You should pass the same path through -L option:

gcc -Wl,-rpath,/home/<user>/Qt/5.10.0/gcc_64/lib -L/home/<user>/Qt/5.10.0/gcc_64/lib ...

Here is more info:

Why is -L needed when -rpath is used?

What's the difference between -rpath and -L?

273K
  • 29,503
  • 10
  • 41
  • 64
  • Please see my update. I just checked the build command. `-L` is already passed as you recommended. Any more suggestions? – Silicomancer Jun 16 '18 at 09:17
  • It seems you have to provide [mcve]. I have no new idea without seeing the full build info. The errors dumps you provided show definitely on linkage with the new system Qt libraries. Maybe the best solution is upgrade Qt Creator and Qt library, or uninstall user local Qt library. – 273K Jun 17 '18 at 01:01
  • Well an example is difficult since it definitely would involve the entire system.I wonder how my application depends on the mentioned libraries. I just run ldd and there are no direct dependencies. – Silicomancer Jun 17 '18 at 10:57
  • Qt Creator is up to date. I will try updating the /home/ libraries to the same version. Still that would be a workaround only :( – Silicomancer Jun 17 '18 at 11:02
  • Did you clean and re-run qmake? – jonspaceharper Jun 17 '18 at 12:10
  • What does `/sbin/ldconfig -v 2>/dev/null | grep -v ^$'\t'`output? And `echo LD_LIBRARY_PATH`. – 273K Jun 17 '18 at 16:18
  • @JonHarper Yes, didn't change anything. – Silicomancer Jun 17 '18 at 17:21
  • This sounds weird, but try manually deleting the Makefiles and rebuilding. – jonspaceharper Jun 17 '18 at 17:23
  • @S.M. See UPDATE2. – Silicomancer Jun 17 '18 at 17:27
  • Follow @JonHarper advice. Remove all temp / generated files and regenerate Makefile and build your project from scratch. – 273K Jun 17 '18 at 17:40
  • @JonHarper Deleting the entire build folder (including makefile), restarting Creator and then rebuilding the application had no effect unfortunately. – Silicomancer Jun 17 '18 at 18:02