title: Qt-version related runtime errors in Qt application
body: <p>I am using Qt Creator to develop and run an application on Linux KDE neon.</p>
  
  <p>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.</p>
  
  <p>When calling that function I get this debug output:</p>
  
  <pre><code>kde-open5: /home/&lt;user&gt;/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/&lt;user&gt;/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/&lt;user&gt;/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/&lt;user&gt;/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/&lt;user&gt;/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/&lt;user&gt;/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/&lt;user&gt;/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/&lt;user&gt;/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/&lt;user&gt;/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/&lt;user&gt;/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/&lt;user&gt;/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/&lt;user&gt;/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/&lt;user&gt;/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/&lt;user&gt;/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/&lt;user&gt;/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/&lt;user&gt;/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/&lt;user&gt;/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/&lt;user&gt;/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/&lt;user&gt;/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)
  </code></pre>
  
  <p>AFAIK the two paths mentioned above are concurrent to each other because one is created by the distribution and one by Qt Creator.</p>
  
  <p>The solution should be using <code>-rpath</code> when linking the application. My application is built with the following command line:</p>
  
  <pre><code>gcc -Wl,-rpath,/home/&lt;user&gt;/Qt/5.10.0/gcc_64/lib .....
  </code></pre>
  
  <p>Looks fine to me. Also the following is passed to gcc:</p>
  
  <pre><code>-L/home/&lt;user&gt;/Qt/5.10.0/gcc_64/lib
  </code></pre>
  
  <p>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?</p>
  
  <p>UPDATE, this is what ldd says about my executable.</p>
  
  <pre><code>linux-vdso.so.1 =&gt;  (0x00007ffd08b1e000)
  libQt5Widgets.so.5 =&gt; /home/&lt;user&gt;/Qt/5.10.0/gcc_64/lib/libQt5Widgets.so.5 (0x00007faa1849b000)
  libQt5Gui.so.5 =&gt; /home/&lt;user&gt;/Qt/5.10.0/gcc_64/lib/libQt5Gui.so.5 (0x00007faa17cb3000)
  libQt5DBus.so.5 =&gt; /home/&lt;user&gt;/Qt/5.10.0/gcc_64/lib/libQt5DBus.so.5 (0x00007faa17a23000)
  libQt5Xml.so.5 =&gt; /home/&lt;user&gt;/Qt/5.10.0/gcc_64/lib/libQt5Xml.so.5 (0x00007faa177e3000)
  libQt5Script.so.5 =&gt; /home/&lt;user&gt;/Qt/5.10.0/gcc_64/lib/libQt5Script.so.5 (0x00007faa1735b000)
  libQt5XmlPatterns.so.5 =&gt; /home/&lt;user&gt;/Qt/5.10.0/gcc_64/lib/libQt5XmlPatterns.so.5 (0x00007faa16d83000)
  libQt5Network.so.5 =&gt; /home/&lt;user&gt;/Qt/5.10.0/gcc_64/lib/libQt5Network.so.5 (0x00007faa169eb000)
  libQt5Core.so.5 =&gt; /home/&lt;user&gt;/Qt/5.10.0/gcc_64/lib/libQt5Core.so.5 (0x00007faa1629b000)
  libpthread.so.0 =&gt; /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007faa1607b000)
  libstdc++.so.6 =&gt; /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007faa15cf3000)
  libm.so.6 =&gt; /lib/x86_64-linux-gnu/libm.so.6 (0x00007faa159e3000)
  libgcc_s.so.1 =&gt; /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007faa157cb000)
  libc.so.6 =&gt; /lib/x86_64-linux-gnu/libc.so.6 (0x00007faa153fb000)
  /lib64/ld-linux-x86-64.so.2 (0x00007faa18cdb000)
  libGL.so.1 =&gt; /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 (0x00007faa15183000)
  libz.so.1 =&gt; /lib/x86_64-linux-gnu/libz.so.1 (0x00007faa14f63000)
  libdbus-1.so.3 =&gt; /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007faa14d13000)
  libicui18n.so.56 =&gt; /home/&lt;user&gt;/Qt/5.10.0/gcc_64/lib/libicui18n.so.56 (0x00007faa14873000)
  libicuuc.so.56 =&gt; /home/&lt;user&gt;/Qt/5.10.0/gcc_64/lib/libicuuc.so.56 (0x00007faa144bb000)
  libicudata.so.56 =&gt; /home/&lt;user&gt;/Qt/5.10.0/gcc_64/lib/libicudata.so.56 (0x00007faa12ad3000)
  libdl.so.2 =&gt; /lib/x86_64-linux-gnu/libdl.so.2 (0x00007faa128cb000)
  libgthread-2.0.so.0 =&gt; /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007faa126c3000)
  libglib-2.0.so.0 =&gt; /lib/x86_64-linux-gnu/libglib-2.0.so.0 (0x00007faa123ab000)
  libexpat.so.1 =&gt; /lib/x86_64-linux-gnu/libexpat.so.1 (0x00007faa1217b000)
  libxcb-dri3.so.0 =&gt; /usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0 (0x00007faa11f73000)
  libxcb-present.so.0 =&gt; /usr/lib/x86_64-linux-gnu/libxcb-present.so.0 (0x00007faa11d6b000)
  libxcb-sync.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libxcb-sync.so.1 (0x00007faa11b63000)
  libxshmfence.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libxshmfence.so.1 (0x00007faa1195b000)
  libglapi.so.0 =&gt; /usr/lib/x86_64-linux-gnu/libglapi.so.0 (0x00007faa1172b000)
  libXext.so.6 =&gt; /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007faa11513000)
  libXdamage.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libXdamage.so.1 (0x00007faa1130b000)
  libXfixes.so.3 =&gt; /usr/lib/x86_64-linux-gnu/libXfixes.so.3 (0x00007faa11103000)
  libX11-xcb.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libX11-xcb.so.1 (0x00007faa10efb000)
  libX11.so.6 =&gt; /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007faa10bbb000)
  libxcb-glx.so.0 =&gt; /usr/lib/x86_64-linux-gnu/libxcb-glx.so.0 (0x00007faa1099b000)
  libxcb-dri2.so.0 =&gt; /usr/lib/x86_64-linux-gnu/libxcb-dri2.so.0 (0x00007faa10793000)
  libxcb.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007faa1056b000)
  libXxf86vm.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libXxf86vm.so.1 (0x00007faa10363000)
  libdrm.so.2 =&gt; /usr/lib/x86_64-linux-gnu/libdrm.so.2 (0x00007faa1014b000)
  libsystemd.so.0 =&gt; /lib/x86_64-linux-gnu/libsystemd.so.0 (0x00007faa18e43000)
  libpcre.so.3 =&gt; /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007faa0fedb000)
  libXau.so.6 =&gt; /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007faa0fcd3000)
  libXdmcp.so.6 =&gt; /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007faa0facb000)
  libselinux.so.1 =&gt; /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007faa0f8a3000)
  librt.so.1 =&gt; /lib/x86_64-linux-gnu/librt.so.1 (0x00007faa0f69b000)
  liblzma.so.5 =&gt; /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007faa0f473000)
  libgcrypt.so.20 =&gt; /lib/x86_64-linux-gnu/libgcrypt.so.20 (0x00007faa0f18b000)
  libgpg-error.so.0 =&gt; /lib/x86_64-linux-gnu/libgpg-error.so.0 (0x00007faa0ef73000)
  </code></pre>
  
  <p>UPDATE2, <code>/sbin/ldconfig -v 2&gt;/dev/null | grep -v ^$'\t'</code> results in:</p>
  
  <pre><code>/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)
  </code></pre>
  
  <p><code>echo $LD_LIBRARY_PATH</code> prints nothing.</p>