title: Deploying dynamically linked Qt 5.7 Widgets application on CentOS 7 - cannot open shared library
body: <p>I'm trying to deploy a dynamically linked Qt 5.7 Widgets application on CentOS 7. It works on my machine without a problem, even though I don't copy <code>libQt5Widgets.so</code> to build directory. However, if I copy the application to another machine it says:</p>
  
  <pre><code>./Application: error while loading shared libraries: libQt5Widgets.so.5: cannot open shared object file: No such file or directory
  </code></pre>
  
  <p>When I check the dependencies with: </p>
  
  <pre><code>ldd ./Application
  </code></pre>
  
  <p>the result is:</p>
  
  <pre><code>linux-vdso.so.1 =&gt;  (0x00007ffdb7126000)
  libQt5Widgets.so.5 =&gt; /opt/Qt5.7.0/5.7/gcc_64/lib/libQt5Widgets.so.5 (0x00007f2d3f33e000)
  libQt5Gui.so.5 =&gt; /opt/Qt5.7.0/5.7/gcc_64/lib/libQt5Gui.so.5 (0x00007f2d3eb95000)
  libQt5Network.so.5 =&gt; /opt/Qt5.7.0/5.7/gcc_64/lib/libQt5Network.so.5 (0x00007f2d3e837000)
  libQt5Core.so.5 =&gt; /opt/Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5 (0x00007f2d3e11c000)
  libGL.so.1 =&gt; /lib64/libGL.so.1 (0x00007f2d3de97000)
  libpthread.so.0 =&gt; /lib64/libpthread.so.0 (0x00007f2d3dc7b000)
  libstdc++.so.6 =&gt; /lib64/libstdc++.so.6 (0x00007f2d3d972000)
  libm.so.6 =&gt; /lib64/libm.so.6 (0x00007f2d3d66f000)
  libgcc_s.so.1 =&gt; /lib64/libgcc_s.so.1 (0x00007f2d3d459000)
  libc.so.6 =&gt; /lib64/libc.so.6 (0x00007f2d3d098000)
  libz.so.1 =&gt; /lib64/libz.so.1 (0x00007f2d3ce81000)
  libicui18n.so.56 =&gt; /opt/Qt5.7.0/5.7/gcc_64/lib/libicui18n.so.56 (0x00007f2d3c9e7000)
  libicuuc.so.56 =&gt; /opt/Qt5.7.0/5.7/gcc_64/lib/libicuuc.so.56 (0x00007f2d3c62f000)
  libicudata.so.56 =&gt; /opt/Qt5.7.0/5.7/gcc_64/lib/libicudata.so.56 (0x00007f2d3ac4b000)
  libdl.so.2 =&gt; /lib64/libdl.so.2 (0x00007f2d3aa47000)
  libgthread-2.0.so.0 =&gt; /lib64/libgthread-2.0.so.0 (0x00007f2d3a845000)
  librt.so.1 =&gt; /lib64/librt.so.1 (0x00007f2d3a63c000)
  libglib-2.0.so.0 =&gt; /lib64/libglib-2.0.so.0 (0x00007f2d3a305000)
  /lib64/ld-linux-x86-64.so.2 (0x00007f2d3fb8e000)
  libexpat.so.1 =&gt; /lib64/libexpat.so.1 (0x00007f2d3a0db000)
  libxcb-dri3.so.0 =&gt; /lib64/libxcb-dri3.so.0 (0x00007f2d39ed7000)
  libxcb-present.so.0 =&gt; /lib64/libxcb-present.so.0 (0x00007f2d39cd4000)
  libxcb-randr.so.0 =&gt; /lib64/libxcb-randr.so.0 (0x00007f2d39ac6000)
  libxcb-xfixes.so.0 =&gt; /lib64/libxcb-xfixes.so.0 (0x00007f2d398bd000)
  libxcb-render.so.0 =&gt; /lib64/libxcb-render.so.0 (0x00007f2d396b3000)
  libxcb-shape.so.0 =&gt; /lib64/libxcb-shape.so.0 (0x00007f2d394af000)
  libxcb-sync.so.1 =&gt; /lib64/libxcb-sync.so.1 (0x00007f2d392a7000)
  libxshmfence.so.1 =&gt; /lib64/libxshmfence.so.1 (0x00007f2d390a4000)
  libglapi.so.0 =&gt; /lib64/libglapi.so.0 (0x00007f2d38e75000)
  libselinux.so.1 =&gt; /lib64/libselinux.so.1 (0x00007f2d38c4d000)
  libXext.so.6 =&gt; /lib64/libXext.so.6 (0x00007f2d38a3b000)
  libXdamage.so.1 =&gt; /lib64/libXdamage.so.1 (0x00007f2d38838000)
  libXfixes.so.3 =&gt; /lib64/libXfixes.so.3 (0x00007f2d38631000)
  libX11-xcb.so.1 =&gt; /lib64/libX11-xcb.so.1 (0x00007f2d3842f000)
  libX11.so.6 =&gt; /lib64/libX11.so.6 (0x00007f2d380f1000)
  libxcb-glx.so.0 =&gt; /lib64/libxcb-glx.so.0 (0x00007f2d37ed6000)
  libxcb-dri2.so.0 =&gt; /lib64/libxcb-dri2.so.0 (0x00007f2d37cd1000)
  libxcb.so.1 =&gt; /lib64/libxcb.so.1 (0x00007f2d37aaf000)
  libXxf86vm.so.1 =&gt; /lib64/libXxf86vm.so.1 (0x00007f2d378a8000)
  libdrm.so.2 =&gt; /lib64/libdrm.so.2 (0x00007f2d37699000)
  libpcre.so.1 =&gt; /lib64/libpcre.so.1 (0x00007f2d37437000)
  libXau.so.6 =&gt; /lib64/libXau.so.6 (0x00007f2d37233000)
  </code></pre>
  
  <p>To solve the problem, I've tried to deploy the following libraries:</p>
  
  <pre><code>Qt5.7.0/5.7/gcc_64/lib/libicui18n.so.56
  Qt5.7.0/5.7/gcc_64/lib/libicuuc.so.56 
  Qt5.7.0/5.7/gcc_64/lib/libicudata.so.56 
  Qt5.7.0/5.7/gcc_64/lib/libQt5Core.so.5.7.0
  Qt5.7.0/5.7/gcc_64/lib/libQt5Widgets.so.5.7.0
  Qt5.7.0/5.7/gcc_64/lib/libQt5Gui.so.5.7.0
  Qt5.7.0/5.7/gcc_64/lib/libQt5Network.so.5.7.0
  </code></pre>
  
  <p>with the application. Also, I've created symbolic links</p>
  
  <pre><code>libQt5Core.so.5
  libQt5Widgets.so.5
  libQt5Gui.so.5
  libQt5Network.so.5
  </code></pre>
  
  <p>to <code>libQt5Widgets.so.5.0.7</code> and the other Qt 5.7 libraries. The remaining shared libraries exist in the other machine too. But it still doesn't work.</p>
  
  <p>It is related to the following topics:
  <a href="https://stackoverflow.com/questions/21244105/qt-project-release-ubuntu-error-while-loading-shared-libraries-libqt5widgets">Qt project release ubuntu - error while loading shared libraries: 
  libQt5Widgets.so.5</a> and <a href="https://stackoverflow.com/questions/39041832/qt5-7-how-to-deploy-qt-application-on-linux">QT5.7 How to deploy Qt Application on Linux</a>.
  But they don't have a solution.</p>
  
  <ol>
  <li>What can be the problem?  </li>
  <li>How do I solve it?</li>
  </ol>
  
  <p>Thanks in advance.</p>