Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Integrating OpenCV libraries in QtCreator on Windows
Forum Updated to NodeBB v4.3 + New Features

Integrating OpenCV libraries in QtCreator on Windows

Scheduled Pinned Locked Moved Installation and Deployment
14 Posts 2 Posters 21.3k 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.
  • SGaistS Offline
    SGaistS Offline
    SGaist
    Lifetime Qt Champion
    wrote on last edited by
    #2

    Hi and welcome to devnet,

    You have to link to the lib files not the dlls. You should also try linking to only the libs your are using.

    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
    • B Offline
      B Offline
      Bogie
      wrote on last edited by
      #3

      Hi:)

      thank you very much for fast answer. But I don't have .lib files in my own compiled version I only .dll and .dll.a.

      In the built version are some .lib files (although I think they are not for the mingw32-compiler I am using but for vc10)
      I tried to link them but I get the same error

      bq. :-1: Error: LNK1104: Cannot open file “libopencv_highgui231d.lib”

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

        Then let's start at the beginning:
        What compiler do you want to use ? Doesn't the OpenCV pre-built package give you what you need ?

        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
        • B Offline
          B Offline
          Bogie
          wrote on last edited by
          #5

          I want to use the mingw compiler, there is a folder in the pre-built package called mingw so I suppose this schould work, but it doesnt.

          There are only *dll and *ddl.a files where I get the same errors as above.

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

            You should rather use something like

            @LIBS += -LC:/OpenCV/opencv_bin/install/mingw/whathever
            -lopencv_highgui231d
            -lopencv_core231d
            etc...
            @

            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
            • B Offline
              B Offline
              Bogie
              wrote on last edited by
              #7

              Yeah thank you very much:) when I added these lines in the .pro file the project gets compiled.

              @LIBS += -LC:/OpenCV/opencv_bin/install/lib/ -llibopencv_core231d
              -llibopencv_highgui231d

              INCLUDEPATH += C:/OpenCV/opencv_bin/install/include
              DEPENDPATH += C:/OpenCV/opencv_bin/install/include
              @

              Unfortunaley after the compiling there is just showing up the console and nothing happends :(

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

                No error message ?

                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
                • B Offline
                  B Offline
                  Bogie
                  wrote on last edited by
                  #9

                  no just the "qt_creator_stub.exe"

                  but this appears even when I uncomment the whole code

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

                    @mat = cv::imread("BM_Logo.JPG");@

                    relative path, in that case you should either copy the image in the same folder as your application or give the absolute path to it.

                    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
                    • B Offline
                      B Offline
                      Bogie
                      wrote on last edited by
                      #11

                      No doesnt change anything.

                      The strange thing is, even the "Hello World" doesnt appear if I use at least one function of the cv library only when I uncomment these functions the "hello world" appears.

                      the output window says:

                      bq. return value = -1073741515

                      and also the debugger crashes immediatly

                      edit:

                      I also tried compiling the project with the console, but when I start the .exe it says:

                      bq. The programm cannot be started, because the ..highgui249.dll is missing on this computer. Reinstall the programm ...

                      When I copy the dlls of opencv in the folder with the executable it says

                      bq. The programm cannot be started, because the ..QtCore4.dll is missing on this computer. Reinstall the programm ...

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

                        Looks like your OpenCV DLLs can't be found.

                        Go the run part of the Project panel, edit the PATH environment variable and add the path to the folder where the OpenCV dlls are located.

                        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
                        • B Offline
                          B Offline
                          Bogie
                          wrote on last edited by
                          #13

                          IT WORKS!!

                          Thank you very much:)

                          you definitely saved my day:)

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

                            You're welcome !

                            Since OpenCV is working now, please update the thread title prepending [solved] so other forum users may know 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