title: GLib-GObject Warning and Errors when I merge two working app made using QTCreator on a Raspberry Pi
body: <p>I have two application that was created using <em>QTCreator (Qt Creator 4.2.0
  Based on Qt 5.7.1)</em> ony my <em>Raspberry Pi 3 Model B+ (Raspbian 9.6 stretch)</em>. </p>
  
  <p>The first application is a Non-qt Plain C++ Application that uses opencv. Where the application would do face detection. The second application is a QT Widgets Application where I have just some QDialogs.</p>
  
  <p>Both applications build and run on the pi. They run perfectly and do what they're supposed to do. Though the QT Widget Application gives this warning during runtime: </p>
  
  <pre><code>libEGL warning: DRI2: failed to authenticate
  qt5ct: using qt5ct plugin
  </code></pre>
  
  <p>But it still works very fine.</p>
  
  <p><strong>The problem comes when I merge this two application</strong>. Even when I'd just put these lines: </p>
  
  <pre><code>INCLUDEPATH += "/usr/local/include/opencv4"
  LIBS += `pkg-config --libs opencv4`
  </code></pre>
  
  <p>on the .pro file of my QT Widget Application so that I can use opencv on that application it gives me these warnings and errors:</p>
  
  <pre><code>libEGL warning: DRI2: failed to authenticate
  qt5ct: using qt5ct plugin
  
  (rpi2:1613): GLib-GObject-WARNING **: cannot register existing type 'GtkWidget'
  
  (rpi2:1613): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
  
  (rpi2:1613): GLib-GObject-WARNING **: cannot register existing type 'GtkBuildable'
  
  (rpi2:1613): GLib-GObject-CRITICAL **: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed
  
  (rpi2:1613): GLib-CRITICAL **: g_once_init_leave: assertion 'result != 0' failed
  
  (rpi2:1613): GLib-GObject-CRITICAL **: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed
  
  (rpi2:1613): GLib-GObject-CRITICAL **: g_type_register_static: assertion 'parent_type &gt; 0' failed
  </code></pre>
  
  <p>I tried researching about it and what I found out that the possible reason for this could be when QT was upgraded to 5.7.0-1, the widget style GTK is not available for QT5 apps (I saw it <a href="https://bbs.archlinux.org/viewtopic.php?id=214147&amp;p=2" rel="nofollow noreferrer">here</a>). And the workaround for this would be to put this <code>QT_STYLE_OVERRIDE=gtk2</code> or this <code>QT_QPA_PLATFORMTHEME=gtk2</code> on my /etc/environment then reboot. But both of them didn't work.</p>
  
  <p><strong>What do I need to do to solve this problem?</strong></p>