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.
  • A Offline
    A Offline
    alphaCharlie
    wrote on last edited by
    #1

    I have looked and looked for an up to date tutorial for using OpenCV 2.4.9 with the newest release of Qt, and I have come up empty.

    I have followed some tutorials but it seems as if because they are outdated, the setup does not work with the newest versions.

    I am using windows 7 64bit with OpenCV 2.4.9, Qt 5.3.2, CMake 3.0.1, and MinGW 64bit compiler.

    Before I share the error I keep getting, I will show what steps I have done.

    After installing the above programs, I set the paths for both the compiler and cmake.
    I opened cmake and used opencv/sources for the source and opencv/release for the new build files
    (These steps were the same in the tutorials I used, and I didn't have a problem with them)

    After configuring and generating the files successfully, I then used the mingw32-make command in the command prompt. This is where I keep getting the error.

    Around the 30% mark, I keep getting an error when it tries to link the CXX shared library for the highgui249.dll. Other errors that show during this period are:

    undefined reference to _imp__ZN7Q...... bad reloc address 0x3a in section .text.......
    recipe for target `modules/highgui/cmakefiles.....

    I have looked for these errors with really no luck either.

    Any help would be greatly appreciated!

    alphaCharlie

    1 Reply Last reply
    0
    • 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