Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Trouble Integrating Qt 5.3.1 with OpenCV 2.4.9 (Solved)
Forum Updated to NodeBB v4.3 + New Features

Trouble Integrating Qt 5.3.1 with OpenCV 2.4.9 (Solved)

Scheduled Pinned Locked Moved 3rd Party Software
12 Posts 3 Posters 7.1k 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.
  • sierdzioS Offline
    sierdzioS Offline
    sierdzio
    Moderators
    wrote on last edited by
    #2

    Undefined reference is a linker error. Combined with bad reloc, this looks to me like a compiler incompatibility clash (or maybe MinGW bug). Are you compiling all the software using the same version (and architecture) of MinGW?

    (Z(:^

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alphaCharlie
      wrote on last edited by
      #3

      To my knowledge, yes.
      Thanks for the reply.

      To start, I just downloaded the Qt/MinGW pack that came together. This did not work. I then read that the MinGW compiler that came in the bundle was the 32bit version. I then uninstalled Qt and the downloaded Qt without the compiler and got the 64bit version. This also did not work. (All the time I was updating my variable paths)

      I also came to the conclusion that it was either the compiler that wasn't working correctly, or that my OpenCV libraries weren't fully defined.

      Every time I try something new, it fails at the same place when it tries to link the highgui249.dll libraries.

      alphaCharlie

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

        Hi and welcome to devnet,

        Before going further, what compiler do you have installed ?
        What Qt package did you install ?
        Did you saw that OpenCV provides pre-built libraries for several compilers ? Did you select the right path when linking to the libraries ?

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

        1 Reply Last reply
        0
        • A Offline
          A Offline
          alphaCharlie
          wrote on last edited by
          #5

          Compiler - MinGW 4.9.1 (32/64bit)
          Qt - 5.3

          OpenCV 2.4.9 only supplies pre-built libraries for vc10, vc11, and vc12 I believe.

          And I am almost positive that I am using the right paths when linking the libraries, which is why I am so confused.

          alphaCharlie

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

            Then you will have to first compile OpenCV with your MinGW version

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

            1 Reply Last reply
            0
            • A Offline
              A Offline
              alphaCharlie
              wrote on last edited by
              #7

              Alright, well then this might sounds like a dumb question, how do I do that?

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

                "Here":http://docs.opencv.org/doc/tutorials/introduction/windows_install/windows_install.html you have the instructions

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

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  alphaCharlie
                  wrote on last edited by
                  #9

                  I followed those instructions and was able to compile openCV with minGW using the -make and -install commands quite easily.

                  After that, am I suppose to do the same process over again but this time including the With_Qt libraries within Cmake?

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

                    Not necessarily, Qt is used in OpenCV for the highgui library to show controls etc. So if you don't use it in your software there's no need for that.

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

                    1 Reply Last reply
                    0
                    • A Offline
                      A Offline
                      alphaCharlie
                      wrote on last edited by
                      #11

                      I figured it out. The cause was the wrong library being linked to CMake. With the new installer for 5.3.1, it opts to a default download of winrt_x64, and msvc2013_64.

                      You need to manually include mingw482_32 when downloading Qt and set the paths to C:\Qt\5.3\mingw482_32 (My path) so that when including the With_Qt, it finds the correct libraries.

                      Thanks for the help.

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

                        Nice you found out !

                        You're welcome !

                        Now that you have it working, please update the thread title prepending [solved] so 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

                        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