Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Opencv Compiling error in Raspberry Pi3
Forum Updated to NodeBB v4.3 + New Features

Opencv Compiling error in Raspberry Pi3

Scheduled Pinned Locked Moved Solved General and Desktop
9 Posts 2 Posters 644 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • R Offline
    R Offline
    Rap3ck
    wrote on last edited by
    #1

    Hi,
    Im using raspberry pi 3 with rasbian OS, Installed QT Creator 4.8.2 and OpenCv. When i have create console application by using Opencv lib., its working fine. all the things are going well.

    But when im going to use widget application with Opencv getting below errors.

    (project_ousl_v_1:979): GLib-GObject-WARNING **: 23:28:47.999: cannot register existing type 'GtkWidget'

    (project_ousl_v_1:979): GLib-GObject-CRITICAL **: 23:28:47.999: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

    (project_ousl_v_1:979): GLib-GObject-WARNING **: 23:28:47.999: cannot register existing type 'GtkBuildable'

    (project_ousl_v_1:979): GLib-GObject-CRITICAL **: 23:28:47.999: g_type_interface_add_prerequisite: assertion 'G_TYPE_IS_INTERFACE (interface_type)' failed

    (project_ousl_v_1:979): GLib-CRITICAL **: 23:28:47.999: g_once_init_leave: assertion 'result != 0' failed

    (project_ousl_v_1:979): GLib-GObject-CRITICAL **: 23:28:47.999: g_type_add_interface_static: assertion 'G_TYPE_IS_INSTANTIATABLE (instance_type)' failed

    (project_ousl_v_1:979): GLib-GObject-CRITICAL **: 23:28:47.999: g_type_register_static: assertion 'parent_type > 0' failed

    When i remove the INCLUDEPATH and LIBS path from the .pro file its working fine, but then i cannot use opencv lib for my application.

    This is the way i used to link opencv Lib file in .pro file

    INCLUDEPATH +=/usr/local/include/opencv4
    LIBS += -L/usr/local/lib -lopencv_core -lopencv_imgcodecs -lopencv_highgui

    Please advise.
    Thanks

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Are you mixing OpenCV highgui and Qt widgets ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      R 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Are you mixing OpenCV highgui and Qt widgets ?

        R Offline
        R Offline
        Rap3ck
        wrote on last edited by
        #3

        @SGaist Thanks for quick feedback. What do you mean by mixing openCv highgui and Qt widgets? Sorry im new to opencv

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Are you using any code from the OpenCV highgui library within your Qt application ? And does that application use the Qt widgets module ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          R 1 Reply Last reply
          0
          • SGaistS SGaist

            Are you using any code from the OpenCV highgui library within your Qt application ? And does that application use the Qt widgets module ?

            R Offline
            R Offline
            Rap3ck
            wrote on last edited by
            #5

            @SGaist Not yet, but after your comment i have updated the path lib as LIBS += -L/usr/local/lib -lopencv_core -lopencv_imgcodecs

            which is basically remove the "-lopencv_highgui" section from the LIBS. then it is compiled without having any error. But when i develop the application using opencv lib will there issues in future?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              Not to my knowledge, the issue at hand here is that it seems that OpenCV was built using its GTK backend which clashes with Qt. If you do not use highgui then you should be fine. Otherwise, you should rebuild OpenCV with Qt as backend.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              R 1 Reply Last reply
              0
              • SGaistS SGaist

                Not to my knowledge, the issue at hand here is that it seems that OpenCV was built using its GTK backend which clashes with Qt. If you do not use highgui then you should be fine. Otherwise, you should rebuild OpenCV with Qt as backend.

                R Offline
                R Offline
                Rap3ck
                wrote on last edited by
                #7

                @SGaist Thank you so much for your quick response. I have struggled with this issue for more than two days, but within your one comment it is almost resolved.

                1 Reply Last reply
                0
                • SGaistS Offline
                  SGaistS Offline
                  SGaist
                  Lifetime Qt Champion
                  wrote on last edited by
                  #8

                  You're welcome !

                  Since you have this working now please mark the thread as solved using the "Topic Tools" button or the three doted button beside the answer you deem correct so that other forum users may know a solution has been found :-)

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  R 1 Reply Last reply
                  0
                  • SGaistS SGaist

                    You're welcome !

                    Since you have this working now please mark the thread as solved using the "Topic Tools" button or the three doted button beside the answer you deem correct so that other forum users may know a solution has been found :-)

                    R Offline
                    R Offline
                    Rap3ck
                    wrote on last edited by
                    #9

                    @SGaist done... :-)

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved