Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

GLib-GObject Warning and Errors when I merge two working app made using QTCreator on a Raspberry Pi



  • I have two application that was created using QTCreator (Qt Creator 4.2.0 Based on Qt 5.7.1) ony my Raspberry Pi 3 Model B+ (Raspbian 9.6 stretch).

    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.

    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:

    libEGL warning: DRI2: failed to authenticate
    qt5ct: using qt5ct plugin
    

    But it still works very fine.

    The problem comes when I merge this two application. Even when I'd just put these lines:

    INCLUDEPATH += "/usr/local/include/opencv4"
    LIBS += `pkg-config --libs opencv4`
    

    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:

    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 > 0' failed
    

    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 here). And the workaround for this would be to put this QT_STYLE_OVERRIDE=gtk2 or this QT_QPA_PLATFORMTHEME=gtk2 on my /etc/environment then reboot. But both of them didn't work.

    What do I need to do to solve this problem?


Log in to reply