Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. Unable to compile Qt+visualGDB+openCV
Forum Update on Monday, May 27th 2025

Unable to compile Qt+visualGDB+openCV

Scheduled Pinned Locked Moved Unsolved Qt Creator and other tools
12 Posts 2 Posters 1.0k Views
  • 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.
  • A Offline
    A Offline
    Ashh
    wrote on 13 Jul 2021, 08:38 last edited by
    #1

    I am new to Qt. I am trying to develop a camera application using openCV on my embedded board running Debian Stretch '9'. I have the application running well on vs2019 (win10) but when I tried to run the same application using 'vs2019+visualGDB' cross compilation, it gives me error of "undefined reference to symbol....." and cv::VideoCapture::VideoCapture()'

    I am not sure whether I should edit .pro file or something else, please suggest.

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 13 Jul 2021, 08:44 last edited by
      #2

      Hi
      But did you compile openVC so the visualGDB cross-compiler helper can find it ?

      When running on Win 10, it uses the win 10 Dlls for OpenCV. Most likely some you downloaded?

      To run it the Debian, you need openVC for linux also.

      But do you ONLY get one undefined symbol message or Tons of them ?

      A 1 Reply Last reply 13 Jul 2021, 08:49
      0
      • M mrjj
        13 Jul 2021, 08:44

        Hi
        But did you compile openVC so the visualGDB cross-compiler helper can find it ?

        When running on Win 10, it uses the win 10 Dlls for OpenCV. Most likely some you downloaded?

        To run it the Debian, you need openVC for linux also.

        But do you ONLY get one undefined symbol message or Tons of them ?

        A Offline
        A Offline
        Ashh
        wrote on 13 Jul 2021, 08:49 last edited by
        #3

        @mrjj yes there are tons of similar messages like "undefined reference to.......cv::VideoCapture::....'
        Please let me know how I can configure it so that 'visualGDB cross-compiler can find it?

        M 1 Reply Last reply 13 Jul 2021, 08:53
        0
        • A Ashh
          13 Jul 2021, 08:49

          @mrjj yes there are tons of similar messages like "undefined reference to.......cv::VideoCapture::....'
          Please let me know how I can configure it so that 'visualGDB cross-compiler can find it?

          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 13 Jul 2021, 08:53 last edited by mrjj
          #4

          @Ashh said in Unable to compile Qt+visualGDB+openCV:

          @mrjj yes there are tons of similar messages like "undefined reference to.......cv::VideoCapture::....'

          Ok then it sounds like it is what i think and not just one function it cant find.

          Please let me know how I can configure it so that 'visualGDB cross-compiler can find it?

          Im afraid I have no idea how to set it up as I never used visualGDB.
          Maybe you can ask them?

          Here its for a pi board.
          https://visualgdb.com/tutorials/raspberry/opencv/camera/
          it has link to
          https://visualgdb.com/tutorials/raspberry/opencv/build/

          That talks about what is needed.

          However, one can already get precompiled openCV for Debian Stretch so maybe there is an easier way then to compile it your self.

          A 1 Reply Last reply 13 Jul 2021, 09:52
          0
          • M mrjj
            13 Jul 2021, 08:53

            @Ashh said in Unable to compile Qt+visualGDB+openCV:

            @mrjj yes there are tons of similar messages like "undefined reference to.......cv::VideoCapture::....'

            Ok then it sounds like it is what i think and not just one function it cant find.

            Please let me know how I can configure it so that 'visualGDB cross-compiler can find it?

            Im afraid I have no idea how to set it up as I never used visualGDB.
            Maybe you can ask them?

            Here its for a pi board.
            https://visualgdb.com/tutorials/raspberry/opencv/camera/
            it has link to
            https://visualgdb.com/tutorials/raspberry/opencv/build/

            That talks about what is needed.

            However, one can already get precompiled openCV for Debian Stretch so maybe there is an easier way then to compile it your self.

            A Offline
            A Offline
            Ashh
            wrote on 13 Jul 2021, 09:52 last edited by Ashh
            #5

            @mrjj Thanks.
            sorry but in this Do I need to create 2 different projects for 'opencv' and 'main application'. since I can generate the base code for Qt application using visualGDB since it supports like... Qmake instead of CMake

            d1bd1c72-398e-4315-8041-62704a5eb281-image.png

            with project templates:
            -Qt5-based application (Deprecated Qmake)
            -Qt5-based application (CMake)
            -Qt4-based application (Deprecated Qmake)

            M 1 Reply Last reply 13 Jul 2021, 10:11
            0
            • A Ashh
              13 Jul 2021, 09:52

              @mrjj Thanks.
              sorry but in this Do I need to create 2 different projects for 'opencv' and 'main application'. since I can generate the base code for Qt application using visualGDB since it supports like... Qmake instead of CMake

              d1bd1c72-398e-4315-8041-62704a5eb281-image.png

              with project templates:
              -Qt5-based application (Deprecated Qmake)
              -Qt5-based application (CMake)
              -Qt4-based application (Deprecated Qmake)

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 13 Jul 2021, 10:11 last edited by mrjj
              #6

              @Ashh
              Hi
              Normally one would build it as seperate project for a given platform.
              It can be usd as shared. SO/DLL or as static lib.

              That is why i think its better to ask the visualGDB vendor as its not clear to me if
              we need to build it locally for it to work or we can somehow make it some preloaded.

              The thing is that for Pi it makes sense to compile it as we need an ARM
              version of openCv but your board is using a
              normal linux - non arm, right so we can easy apt-get isntall openCV there so
              I wonder if you get true LINKER errors or it cant find the includes are some are also undefined
              symbols in the compile phase.

              But I dont know how visualGDB does the magic so nto sure what is the correct way in your case.

              A 1 Reply Last reply 13 Jul 2021, 10:29
              1
              • M mrjj
                13 Jul 2021, 10:11

                @Ashh
                Hi
                Normally one would build it as seperate project for a given platform.
                It can be usd as shared. SO/DLL or as static lib.

                That is why i think its better to ask the visualGDB vendor as its not clear to me if
                we need to build it locally for it to work or we can somehow make it some preloaded.

                The thing is that for Pi it makes sense to compile it as we need an ARM
                version of openCv but your board is using a
                normal linux - non arm, right so we can easy apt-get isntall openCV there so
                I wonder if you get true LINKER errors or it cant find the includes are some are also undefined
                symbols in the compile phase.

                But I dont know how visualGDB does the magic so nto sure what is the correct way in your case.

                A Offline
                A Offline
                Ashh
                wrote on 13 Jul 2021, 10:29 last edited by Ashh
                #7

                @mrjj Thanks for your well explanation. :)
                FYI: my board is beaglebone, seems not much differ from Pi.

                M 1 Reply Last reply 13 Jul 2021, 10:38
                0
                • A Ashh
                  13 Jul 2021, 10:29

                  @mrjj Thanks for your well explanation. :)
                  FYI: my board is beaglebone, seems not much differ from Pi.

                  M Offline
                  M Offline
                  mrjj
                  Lifetime Qt Champion
                  wrote on 13 Jul 2021, 10:38 last edited by
                  #8

                  Hi
                  Np :)

                  beaglebone

                  Oh yes. well, then the PI tut should work.
                  It is indeed very much the same. Also an arm etc.

                  Can you already cross compile a non OpenCV Qt app and run it on the board?

                  I would start with that before trying with openCV. just to know the Qt part does work.

                  1 Reply Last reply
                  0
                  • A Offline
                    A Offline
                    Ashh
                    wrote on 13 Jul 2021, 12:25 last edited by Ashh
                    #9

                    @mrjj yes, i have tested non opencv Qt app on BB through visualGDB, it works. but when added up openCV, it gives errors related to cv::, not sure what I am missing to include....

                    A 1 Reply Last reply 14 Jul 2021, 07:23
                    0
                    • A Ashh
                      13 Jul 2021, 12:25

                      @mrjj yes, i have tested non opencv Qt app on BB through visualGDB, it works. but when added up openCV, it gives errors related to cv::, not sure what I am missing to include....

                      A Offline
                      A Offline
                      Ashh
                      wrote on 14 Jul 2021, 07:23 last edited by Ashh
                      #10

                      @mrjj Is it something, I need to add files to *.pro? please suggest~
                      I followed this https://visualgdb.com/tutorials/raspberry/opencv/ and tested on BB through visualGDB, workd well. but still I didnt understand to resolve the errors related to cv::VideoCapture::VideoCapture()'....

                      M 1 Reply Last reply 14 Jul 2021, 07:45
                      0
                      • A Ashh
                        14 Jul 2021, 07:23

                        @mrjj Is it something, I need to add files to *.pro? please suggest~
                        I followed this https://visualgdb.com/tutorials/raspberry/opencv/ and tested on BB through visualGDB, workd well. but still I didnt understand to resolve the errors related to cv::VideoCapture::VideoCapture()'....

                        M Offline
                        M Offline
                        mrjj
                        Lifetime Qt Champion
                        wrote on 14 Jul 2021, 07:45 last edited by
                        #11

                        @Ashh
                        Hi
                        So it did work following the tut for the PI even its other board ?

                        But then when trying the same with your project you get lots of liner errors still ?

                        Yes to use SO files one does add stuff to the project file but if you also use Cmake, it should be just as with the tut.

                        A 1 Reply Last reply 14 Jul 2021, 08:48
                        0
                        • M mrjj
                          14 Jul 2021, 07:45

                          @Ashh
                          Hi
                          So it did work following the tut for the PI even its other board ?

                          But then when trying the same with your project you get lots of liner errors still ?

                          Yes to use SO files one does add stuff to the project file but if you also use Cmake, it should be just as with the tut.

                          A Offline
                          A Offline
                          Ashh
                          wrote on 14 Jul 2021, 08:48 last edited by Ashh
                          #12

                          @mrjj yes OpenCV2Demo works on BB through visualGDB considering these configs....

                          Debug settings---> Executable arguments---> /home/debian/Downloads/Lena.png (as suggested in post)
                          Uncheck 'custom working directory' (as suggested in post)

                          After save and run, it notify for this message... (I check 'Yes')
                          c27ab354-1177-4cf9-a119-89a88fe0da91-image.png

                          Error:
                          00e899c0-f685-41c9-8253-f07b2ed5db1b-image.png

                          After save and run, it notify for this message... (I check 'No')
                          I get the Lena.png as display (good!)

                          Also, when I direct run ./OpenCV2Demo directly on BB, it gives me error as....
                          23994007-c3c8-4832-8258-1b7f7bac6f2e-image.png

                          Please suggest~ Thanks.

                          1 Reply Last reply
                          0

                          1/12

                          13 Jul 2021, 08:38

                          • Login

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