title: C++ Qt 5.10 Cross compiling for Raspberry PI 3 This application failed to start because it could not find or load the Qt platform plugin "xcb" in ""
body: <p>i have tried to cross compile qt 5.10 for my Rasperry pi 3. I had used the following guide to finish the task:
  <a href="https://wiki.qt.io/RaspberryPi2EGLFS#Step_by_step" rel="nofollow noreferrer">Step by step to compile</a></p>
  
  <p>I have used the following command to do this:</p>
  
  <pre><code>sudo ./configure -release -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-
  gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -v -no-use-gold-linker
  </code></pre>
  
  <p>There was no Problem to do this. 
  Now i have tryed to run the example qopenglwidget but i get the following error message:</p>
  
  <blockquote>
    <p>sudo ./qopenglwidget</p>
    
    <p>This application failed to start because it could not find or load the Qt >platform plugin "xcb" in "".</p>
    
    <p>Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, >vnc, xcb.
    Reinstalling the application may fix this problem.</p>
    
    <p>Aborted</p>
  </blockquote>
  
  <p>I have tried the ldd on the application and get hte following output:</p>
  
  <pre><code>ldd qopenglwidget
      linux-vdso.so.1 (0x7e9a4000)
      /usr/lib/arm-linux-gnueabihf/libarmmem.so (0x76f77000)
      libQt5Widgets.so.5 =&gt; /usr/lib/arm-linux-gnueabihf/libQt5Widgets.so.5 (0x76a11000)
      libQt5Gui.so.5 =&gt; /usr/lib/arm-linux-gnueabihf/libQt5Gui.so.5 (0x765eb000)
      libQt5Core.so.5 =&gt; /usr/local/qt5pi2/lib/libQt5Core.so.5 (0x760b9000)
      libGLESv2.so =&gt; /opt/vc/lib/libGLESv2.so (0x76094000)
      libpthread.so.0 =&gt; /lib/arm-linux-gnueabihf/libpthread.so.0 (0x7606b000)
      libstdc++.so.6 =&gt; /usr/lib/arm-linux-gnueabihf/libstdc++.so.6 (0x75f23000)
      libm.so.6 =&gt; /lib/arm-linux-gnueabihf/libm.so.6 (0x75ea4000)
      libgcc_s.so.1 =&gt; /lib/arm-linux-gnueabihf/libgcc_s.so.1 (0x75e77000)
      libc.so.6 =&gt; /lib/arm-linux-gnueabihf/libc.so.6 (0x75d38000)
      /lib/ld-linux-armhf.so.3 (0x76f8d000)
      libharfbuzz.so.0 =&gt; /usr/lib/arm-linux-gnueabihf/libharfbuzz.so.0 (0x75ca1000)
      libz.so.1 =&gt; /lib/arm-linux-gnueabihf/libz.so.1 (0x75c7a000)
      libpng16.so.16 =&gt; /usr/lib/arm-linux-gnueabihf/libpng16.so.16 (0x75c40000)
      libdouble-conversion.so.1 =&gt; /usr/lib/arm-linux-gnueabihf/libdouble-conversion.so.1 (0x75c1e000)
      libdl.so.2 =&gt; /lib/arm-linux-gnueabihf/libdl.so.2 (0x75c0b000)
      libgthread-2.0.so.0 =&gt; /usr/lib/arm-linux-gnueabihf/libgthread-2.0.so.0 (0x75bf9000)
      libglib-2.0.so.0 =&gt; /lib/arm-linux-gnueabihf/libglib-2.0.so.0 (0x75af1000)
      libEGL.so =&gt; /opt/vc/lib/libEGL.so (0x75ab8000)
      libbcm_host.so =&gt; /opt/vc/lib/libbcm_host.so (0x75a91000)
      libvchiq_arm.so =&gt; /opt/vc/lib/libvchiq_arm.so (0x75a7b000)
      libvcos.so =&gt; /opt/vc/lib/libvcos.so (0x75a61000)
      librt.so.1 =&gt; /lib/arm-linux-gnueabihf/librt.so.1 (0x75a4a000)
      libfreetype.so.6 =&gt; /usr/lib/arm-linux-gnueabihf/libfreetype.so.6 (0x759af000)
      libgraphite2.so.3 =&gt; /usr/lib/arm-linux-gnueabihf/libgraphite2.so.3 (0x7597c000)
      libpcre.so.3 =&gt; /lib/arm-linux-gnueabihf/libpcre.so.3 (0x75903000)
  </code></pre>
  
  <p>I have tried to set the LDD_LIBRARY_PATH to /usr/local/qt5pi2/platforms but it don't work. </p>
  
  <p>Please have someone any idea what i have done wrong?</p>
  
  <p>After i have add the QT_QPA_PLATFORM_PLUGIN_PATH i get the following error:</p>
  
  <blockquote>
    <p>./qopenglwidget
    This application failed to start because it could not find or load the Qt >platform plugin "xcb"
    in "/usr/local/qt5pi/plugins/platforms/".</p>
    
    <p>Available platform plugins are: eglfs (from >/usr/local/qt5pi/plugins/platforms/), linuxfb (from >/usr/local/qt5pi/plugins/platforms/), minimal (from >/usr/local/qt5pi/plugins/platforms/), minimalegl (from >/usr/local/qt5pi/plugins/platforms/), offscreen (from >/usr/local/qt5pi/plugins/platforms/), vnc (from >/usr/local/qt5pi/plugins/platforms/), xcb (from >/usr/local/qt5pi/plugins/platforms/), eglfs, linuxfb, minimal, minimalegl, >offscreen, vnc.</p>
    
    <p>Reinstalling the application may fix this problem.
    Aborted</p>
  </blockquote>
  
  <p>After the help of  p-a-o-l-o (thank you very much)i have export the </p>
  
  <pre><code>QT_QPA_PLATFORM_PLUGIN_PATH 
  </code></pre>
  
  <p>and after that i have done the following:</p>
  
  <pre><code>export LD_LIBRARY_PATH=/usr/local/qt5pi/lib
  sudo ldconfig
  </code></pre>
  
  <p>Now it works for me.</p>
  
  <p>I someone else will try to crosscompile qt 5.10 for the raspberry pi it is important to start with a blank System (Raspbian stretch) and do only the thing in the guide above.</p>