title: Qt5-powered app uses Qt4-libs and fails. How to avoid this?
body: <p>I have built Qt5 from sources and use to build my app. Unfortunately,
  it fails in some internal function of VLC player (I call libvlc_new
  function). There is a topmost line in a call stack:</p>
  
  <pre><code>Level   Function      File
  0    ??    /usr/lib/x86_64-linux-gnu/libQtGui.so.4        0x7fffdb861afc
  1    ??    /lib64/ld-linux-x86-64.so.2        0x7ffff7deb1a6
  2    ??    /lib64/ld-linux-x86-64.so.2        0x7ffff7deb28a
  3    ??    /lib64/ld-linux-x86-64.so.2        0x7ffff7def20f
  4    ??    /lib64/ld-linux-x86-64.so.2        0x7ffff7deafe6
  5    ??    /lib64/ld-linux-x86-64.so.2        0x7ffff7deeb7c
  6    dlopen_doit    dlopen.c    67    0x7fffee6d7016
  7    ??    /lib64/ld-linux-x86-64.so.2        0x7ffff7deafe6
  8    _dlerror_run    dlerror.c    164    0x7fffee6d75ec
  9    __dlopen    dlopen.c    88    0x7fffee6d70b1
  10    ??    /usr/lib/libvlccore.so.5        0x7fffef1b98fd
  11    ??    /usr/lib/libvlccore.so.5        0x7fffef1a0927
  12    ??    /usr/lib/libvlccore.so.5        0x7fffef1a0bfb
  13    ??    /usr/lib/libvlccore.so.5        0x7fffef1a0ded
  14    ??    /usr/lib/libvlccore.so.5        0x7fffef1a0f10
  15    ??    /usr/lib/libvlccore.so.5        0x7fffef1a159d
  16    libvlc_InternalInit    /usr/lib/libvlccore.so.5        0x7fffef1366eb
  17    libvlc_new    /usr/lib/libvlc.so.5        0x7ffff6fd3625
  18    QVlcInstance::QVlcInstance    qvlcinstance.cpp    54    0x7ffff6694228
  19    VideoPlayer::VideoPlayer    VideoPlayer.cpp    12    0x4b988a
  20    ResourcePlayer::registerPlayersAndControls    ResourcePlayer.cpp    196    0x4c019b
  ...    &lt;More&gt;
  </code></pre>
  
  <p>There is Qt4 libs in /usr/lib/x86_64-linux-gnu directory, indeed
  ('ldconfig -v' shows them). It explains the SIGSEGV signal, because
  the version of Qt is completely different. But, I can not figure out
  the reason why Qt4 libs are even used? Prior to running my app, I
  deleted auto-detected Qt version from QtCreator.</p>
  
  <p>I've analyzed my executable with ldd (I use Debian-based distro) and
  it shows only Qt5 libs:</p>
  
  <pre><code>$ ldd bin_debug/editor
      linux-vdso.so.1 =&gt;  (0x00007fff91bff000)
      libfbxsdk.so =&gt; not found
      libflashviewd.so.1 =&gt; not found
      libvlc.so.5 =&gt; /usr/lib/libvlc.so.5 (0x00007f6eb49bd000)
      libglsceneviewd.so.1 =&gt; not found
      libqwikpadwidgetd.so.1 =&gt; not found
      libLogger.so.1 =&gt; not found
      libqtvlcd.so.1 =&gt; not found
      libQt5WebKitWidgets.so.5 =&gt; /aux/dev/qt/qt5.1/qtbase/lib/libQt5WebKitWidgets.so.5   (0x00007f6eb4779000)
      libX11.so.6 =&gt; /usr/lib/x86_64-linux-gnu/libX11.so.6    (0x00007f6eb443d000)
      libxslt.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libxslt.so.1  (0x00007f6eb41ff000)
      libxml2.so.2 =&gt; /usr/lib/x86_64-linux-gnu/libxml2.so.2  (0x00007f6eb3ea0000)
      libQt53D.so.5 =&gt; /aux/dev/qt/qt5.1/qtbase/lib/libQt53D.so.5 (0x00007f6eb3962000)
      libQt5MultimediaWidgets.so.5 =&gt; /aux/dev/qt/qt5.1/qtbase/lib/libQt5MultimediaWidgets.so.5   (0x00007f6eb3744000)
      libQt5Quick.so.5 =&gt; /aux/dev/qt/qt5.1/qtbase/lib/libQt5Quick.so.5 (0x00007f6eb321c000)
      libQt5OpenGL.so.5 =&gt;    /aux/dev/qt/qt5.1/qtbase/lib/libQt5OpenGL.so.5 (0x00007f6eb2fb6000)
      libQt5PrintSupport.so.5 =&gt;  /aux/dev/qt/qt5.1/qtbase/lib/libQt5PrintSupport.so.5    (0x00007f6eb2d62000)
      libQt5Multimedia.so.5 =&gt;    /aux/dev/qt/qt5.1/qtbase/lib/libQt5Multimedia.so.5  (0x00007f6eb2a99000)
      libQt5Qml.so.5 =&gt; /aux/dev/qt/qt5.1/qtbase/lib/libQt5Qml.so.5   (0x00007f6eb2617000)
      libQt5WebKit.so.5 =&gt;    /aux/dev/qt/qt5.1/qtbase/lib/libQt5WebKit.so.5 (0x00007f6eb03f6000)
      libQt5Widgets.so.5 =&gt;   /aux/dev/qt/qt5.1/qtbase/lib/libQt5Widgets.so.5 (0x00007f6eafc18000)
      libQt5Sensors.so.5 =&gt;   /aux/dev/qt/qt5.1/qtbase/lib/libQt5Sensors.so.5 (0x00007f6eaf9db000)
      libQt5Network.so.5 =&gt;   /aux/dev/qt/qt5.1/qtbase/lib/libQt5Network.so.5 (0x00007f6eaf69d000)
      libQt5Sql.so.5 =&gt; /aux/dev/qt/qt5.1/qtbase/lib/libQt5Sql.so.5   (0x00007f6eaf45e000)
      libQt5Gui.so.5 =&gt; /aux/dev/qt/qt5.1/qtbase/lib/libQt5Gui.so.5   (0x00007f6eaee1b000)
      libQt5Core.so.5 =&gt;  /aux/dev/qt/qt5.1/qtbase/lib/libQt5Core.so.5 (0x00007f6eae7ad000)
      libGL.so.1 =&gt; /usr/lib/libGL.so.1 (0x00007f6eae47f000)
      libpthread.so.0 =&gt; /lib/x86_64-linux-gnu/libpthread.so.0    (0x00007f6eae261000)
      libstdc++.so.6 =&gt; /usr/lib/x86_64-linux-gnu/libstdc++.so.6  (0x00007f6eadf5a000)
      libm.so.6 =&gt; /lib/x86_64-linux-gnu/libm.so.6 (0x00007f6eadcd7000)
      libgcc_s.so.1 =&gt; /lib/x86_64-linux-gnu/libgcc_s.so.1    (0x00007f6eadac0000)
      libc.so.6 =&gt; /lib/x86_64-linux-gnu/libc.so.6 (0x00007f6ead734000)
      libvlccore.so.5 =&gt; /usr/lib/libvlccore.so.5 (0x00007f6ead44a000)
      libXext.so.6 =&gt; /usr/lib/x86_64-linux-gnu/libXext.so.6  (0x00007f6ead238000)
      libxcb.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libxcb.so.1    (0x00007f6ead018000)
      libdl.so.2 =&gt; /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f6eace14000)
      libz.so.1 =&gt; /lib/x86_64-linux-gnu/libz.so.1 (0x00007f6eacbfb000)
      liblzma.so.5 =&gt; /lib/x86_64-linux-gnu/liblzma.so.5 (0x00007f6eac9d8000)
      libQt5V8.so.5 =&gt; /aux/dev/qt/qt5.1/qtbase/lib/libQt5V8.so.5 (0x00007f6eac340000)
      librt.so.1 =&gt; /lib/x86_64-linux-gnu/librt.so.1 (0x00007f6eac138000)
      libXrender.so.1 =&gt; /usr/lib/x86_64-linux-gnu/libXrender.so.1    (0x00007f6eabf2e000)
      libicui18n.so.48 =&gt; /usr/lib/x86_64-linux-gnu/libicui18n.so.48  (0x00007f6eabb62000)
      libicuuc.so.48 =&gt; /usr/lib/x86_64-linux-gnu/libicuuc.so.48  (0x00007f6eab7f3000)
      libicudata.so.48 =&gt; /usr/lib/x86_64-linux-gnu/libicudata.so.48  (0x00007f6eaa482000)
      libgthread-2.0.so.0 =&gt;  /usr/lib/x86_64-linux-gnu/libgthread-2.0.so.0 (0x00007f6eaa280000)
      libglib-2.0.so.0 =&gt; /lib/x86_64-linux-gnu/libglib-2.0.so.0  (0x00007f6ea9f87000)
      /lib64/ld-linux-x86-64.so.2 (0x00007f6eb4bf1000)
      libnvidia-tls.so.319.32 =&gt;  /usr/lib/tls/libnvidia-tls.so.319.32 (0x00007f6ea9d84000)
      libnvidia-glcore.so.319.32 =&gt;   /usr/lib/libnvidia-glcore.so.319.32 (0x00007f6ea782d000)
      libdbus-1.so.3 =&gt; /lib/x86_64-linux-gnu/libdbus-1.so.3 (0x00007f6ea75e6000)
      libXau.so.6 =&gt; /usr/lib/x86_64-linux-gnu/libXau.so.6    (0x00007f6ea73e3000)
      libXdmcp.so.6 =&gt; /usr/lib/x86_64-linux-gnu/libXdmcp.so.6    (0x00007f6ea71dd000)
      libpcre.so.3 =&gt; /lib/x86_64-linux-gnu/libpcre.so.3 (0x00007f6ea6fa0000)
  </code></pre>
  
  <p>libvlccore.so does not use Qt at all:</p>
  
  <pre><code>$ ldd /usr/lib/libvlccore.so
      linux-vdso.so.1 =&gt;  (0x00007fffd85ff000)
      libdbus-1.so.3 =&gt; /lib/x86_64-linux-gnu/libdbus-1.so.3  (0x00007fd102675000)
      librt.so.1 =&gt; /lib/x86_64-linux-gnu/librt.so.1 (0x00007fd10246d000)
      libpthread.so.0 =&gt; /lib/x86_64-linux-gnu/libpthread.so.0    (0x00007fd10224f000)
      libdl.so.2 =&gt; /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fd10204b000)
      libm.so.6 =&gt; /lib/x86_64-linux-gnu/libm.so.6 (0x00007fd101dc8000)
      libc.so.6 =&gt; /lib/x86_64-linux-gnu/libc.so.6 (0x00007fd101a3b000)
      /lib64/ld-linux-x86-64.so.2 (0x00007fd102bbd000)
  </code></pre>
  
  <p>Seems that I've messed up with using several versions of Qt. Any
  ideas? Thanks in advance.</p>
  
  <p>PS. I configure Qt with following options:</p>
  
  <pre><code>./configure -qt-xcb -prefix "$PWD/qtbase" -opensource -confirm-license -nomake examples -nomake tests
  </code></pre>
  
  <p>PS2. I am unable to uninstall Qt4 libs, becuase distro is packaged with KDE.</p>