Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. OpenCV error
Forum Updated to NodeBB v4.3 + New Features

OpenCV error

Scheduled Pinned Locked Moved Solved QML and Qt Quick
15 Posts 3 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.
  • V Offline
    V Offline
    Vijaykarthikeyan
    wrote on 8 Jan 2024, 11:34 last edited by
    #1

    Screenshot 2024-01-08 170056.png

    How to diagonise it

    J 1 Reply Last reply 8 Jan 2024, 12:37
    0
    • J JonB
      8 Jan 2024, 14:54

      @Vijaykarthikeyan said in OpenCV error:

      but how to correclty link the .dll file in .pro..please someone guide me

      You don't link to .dll files. You don't mention .dll files in a .pro file. You need to stick to examples, they don't.
      OK, I think I see, they name the library files lib....dll.a.
      I don't use Windows/MinGW, is it supposed to be -lopencv....dll? Without the leading lib?
      But if your code links fine with what you have in the .pro file that's fine.

      @jsulm

      -lNAME_OF_THE_LIB.lib

      I think we are talking MinGW not MSVC here? lib....a files.

      At runtime your program has to find libopen....dll file. That needs to be in the same directory as the executable or specified in PATH. I think yours is not? Where is libopencv_....dll per error message, I only see libopencv....dll.a?

      V Offline
      V Offline
      Vijaykarthikeyan
      wrote on 9 Jan 2024, 05:39 last edited by Vijaykarthikeyan 1 Sept 2024, 05:40
      #11

      @JonB you're absolutely correct..Thanks for clarifying me.Actually,For the previous projects using opencv..i have included one line which I'm missing in this that's why error hits.

      Actually when linking third party libraries against to Qt..we must include it's path to qmake flags.

      So, we must include this:

      # Add the include path to QMAKE_CXXFLAGS
      QMAKE_CXXFLAGS += -I$$PWD/C:/opencv2/include
      
      J 1 Reply Last reply 9 Jan 2024, 06:12
      0
      • V Vijaykarthikeyan
        8 Jan 2024, 11:34

        Screenshot 2024-01-08 170056.png

        How to diagonise it

        J Offline
        J Offline
        jsulm
        Lifetime Qt Champion
        wrote on 8 Jan 2024, 12:37 last edited by
        #2

        @Vijaykarthikeyan There is nothing to diagnose, simply deploy missing library together with your application

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        V 1 Reply Last reply 8 Jan 2024, 14:04
        1
        • J jsulm
          8 Jan 2024, 12:37

          @Vijaykarthikeyan There is nothing to diagnose, simply deploy missing library together with your application

          V Offline
          V Offline
          Vijaykarthikeyan
          wrote on 8 Jan 2024, 14:04 last edited by
          #3

          @jsulm Screenshot 2024-01-08 193328.png

          already included before asking this question...but till now..unable to diagnose

          J J 2 Replies Last reply 8 Jan 2024, 14:17
          0
          • V Vijaykarthikeyan
            8 Jan 2024, 14:04

            @jsulm Screenshot 2024-01-08 193328.png

            already included before asking this question...but till now..unable to diagnose

            J Offline
            J Offline
            jsulm
            Lifetime Qt Champion
            wrote on 8 Jan 2024, 14:17 last edited by
            #4

            @Vijaykarthikeyan I'm not talking about project configuration and build but about deployment
            https://doc.qt.io/qt-6/deployment.html

            The application needs the library at runtime, so it needs to be deployed together with the application.

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            1 Reply Last reply
            3
            • V Vijaykarthikeyan
              8 Jan 2024, 14:04

              @jsulm Screenshot 2024-01-08 193328.png

              already included before asking this question...but till now..unable to diagnose

              J Offline
              J Offline
              JonB
              wrote on 8 Jan 2024, 14:18 last edited by
              #5

              @Vijaykarthikeyan
              I don't understand: you are using -llib....dll as libraries to link against, how does that work? But in any case the error is a runtime error failing to locate the .dll file, I don't see how that is connected to linking.

              V 1 Reply Last reply 8 Jan 2024, 14:22
              0
              • J JonB
                8 Jan 2024, 14:18

                @Vijaykarthikeyan
                I don't understand: you are using -llib....dll as libraries to link against, how does that work? But in any case the error is a runtime error failing to locate the .dll file, I don't see how that is connected to linking.

                V Offline
                V Offline
                Vijaykarthikeyan
                wrote on 8 Jan 2024, 14:22 last edited by
                #6

                @JonB Screenshot 2024-01-08 195210.png

                i didnt changed the library name..can i change that

                J 1 Reply Last reply 8 Jan 2024, 14:30
                0
                • V Vijaykarthikeyan
                  8 Jan 2024, 14:22

                  @JonB Screenshot 2024-01-08 195210.png

                  i didnt changed the library name..can i change that

                  J Offline
                  J Offline
                  jsulm
                  Lifetime Qt Champion
                  wrote on 8 Jan 2024, 14:30 last edited by
                  #7

                  @Vijaykarthikeyan What @JonB means is that on Windows you need *.lib files for -l and *.dll at runtime. So, you -l are wrong.

                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                  V 1 Reply Last reply 8 Jan 2024, 14:40
                  0
                  • J jsulm
                    8 Jan 2024, 14:30

                    @Vijaykarthikeyan What @JonB means is that on Windows you need *.lib files for -l and *.dll at runtime. So, you -l are wrong.

                    V Offline
                    V Offline
                    Vijaykarthikeyan
                    wrote on 8 Jan 2024, 14:40 last edited by
                    #8

                    @jsulm yes ofcourse lib for static and dll for runtime..but how to correclty link the .dll file in .pro..please someone guide me

                    J J 2 Replies Last reply 8 Jan 2024, 14:49
                    0
                    • V Vijaykarthikeyan
                      8 Jan 2024, 14:40

                      @jsulm yes ofcourse lib for static and dll for runtime..but how to correclty link the .dll file in .pro..please someone guide me

                      J Offline
                      J Offline
                      jsulm
                      Lifetime Qt Champion
                      wrote on 8 Jan 2024, 14:49 last edited by
                      #9

                      @Vijaykarthikeyan said in OpenCV error:

                      yes ofcourse lib for static and dll for runtime

                      NO! You're not using static libs!
                      Again: you do not link dll files, you link lib files:

                      -lNAME_OF_THE_LIB.lib
                      

                      When deploying the app you deploy dll files. Please read the link I gave you. And also https://doc.qt.io/qt-6/windows-deployment.html

                      https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      0
                      • V Vijaykarthikeyan
                        8 Jan 2024, 14:40

                        @jsulm yes ofcourse lib for static and dll for runtime..but how to correclty link the .dll file in .pro..please someone guide me

                        J Offline
                        J Offline
                        JonB
                        wrote on 8 Jan 2024, 14:54 last edited by JonB 1 Aug 2024, 15:02
                        #10

                        @Vijaykarthikeyan said in OpenCV error:

                        but how to correclty link the .dll file in .pro..please someone guide me

                        You don't link to .dll files. You don't mention .dll files in a .pro file. You need to stick to examples, they don't.
                        OK, I think I see, they name the library files lib....dll.a.
                        I don't use Windows/MinGW, is it supposed to be -lopencv....dll? Without the leading lib?
                        But if your code links fine with what you have in the .pro file that's fine.

                        @jsulm

                        -lNAME_OF_THE_LIB.lib

                        I think we are talking MinGW not MSVC here? lib....a files.

                        At runtime your program has to find libopen....dll file. That needs to be in the same directory as the executable or specified in PATH. I think yours is not? Where is libopencv_....dll per error message, I only see libopencv....dll.a?

                        V 1 Reply Last reply 9 Jan 2024, 05:39
                        1
                        • J JonB
                          8 Jan 2024, 14:54

                          @Vijaykarthikeyan said in OpenCV error:

                          but how to correclty link the .dll file in .pro..please someone guide me

                          You don't link to .dll files. You don't mention .dll files in a .pro file. You need to stick to examples, they don't.
                          OK, I think I see, they name the library files lib....dll.a.
                          I don't use Windows/MinGW, is it supposed to be -lopencv....dll? Without the leading lib?
                          But if your code links fine with what you have in the .pro file that's fine.

                          @jsulm

                          -lNAME_OF_THE_LIB.lib

                          I think we are talking MinGW not MSVC here? lib....a files.

                          At runtime your program has to find libopen....dll file. That needs to be in the same directory as the executable or specified in PATH. I think yours is not? Where is libopencv_....dll per error message, I only see libopencv....dll.a?

                          V Offline
                          V Offline
                          Vijaykarthikeyan
                          wrote on 9 Jan 2024, 05:39 last edited by Vijaykarthikeyan 1 Sept 2024, 05:40
                          #11

                          @JonB you're absolutely correct..Thanks for clarifying me.Actually,For the previous projects using opencv..i have included one line which I'm missing in this that's why error hits.

                          Actually when linking third party libraries against to Qt..we must include it's path to qmake flags.

                          So, we must include this:

                          # Add the include path to QMAKE_CXXFLAGS
                          QMAKE_CXXFLAGS += -I$$PWD/C:/opencv2/include
                          
                          J 1 Reply Last reply 9 Jan 2024, 06:12
                          0
                          • V Vijaykarthikeyan
                            9 Jan 2024, 05:39

                            @JonB you're absolutely correct..Thanks for clarifying me.Actually,For the previous projects using opencv..i have included one line which I'm missing in this that's why error hits.

                            Actually when linking third party libraries against to Qt..we must include it's path to qmake flags.

                            So, we must include this:

                            # Add the include path to QMAKE_CXXFLAGS
                            QMAKE_CXXFLAGS += -I$$PWD/C:/opencv2/include
                            
                            J Offline
                            J Offline
                            jsulm
                            Lifetime Qt Champion
                            wrote on 9 Jan 2024, 06:12 last edited by
                            #12

                            @Vijaykarthikeyan said in OpenCV error:

                            QMAKE_CXXFLAGS += -I$$PWD/C:/opencv2/include

                            This is actually done using INCLUDEPATH in pro file

                            https://forum.qt.io/topic/113070/qt-code-of-conduct

                            V 1 Reply Last reply 9 Jan 2024, 07:24
                            2
                            • J jsulm
                              9 Jan 2024, 06:12

                              @Vijaykarthikeyan said in OpenCV error:

                              QMAKE_CXXFLAGS += -I$$PWD/C:/opencv2/include

                              This is actually done using INCLUDEPATH in pro file

                              V Offline
                              V Offline
                              Vijaykarthikeyan
                              wrote on 9 Jan 2024, 07:24 last edited by
                              #13

                              @jsulm so like this:
                              INCLUDEPATH += -I$$PWD/C:/opencv2/include

                              J 1 Reply Last reply 9 Jan 2024, 07:27
                              0
                              • V Vijaykarthikeyan
                                9 Jan 2024, 07:24

                                @jsulm so like this:
                                INCLUDEPATH += -I$$PWD/C:/opencv2/include

                                J Offline
                                J Offline
                                jsulm
                                Lifetime Qt Champion
                                wrote on 9 Jan 2024, 07:27 last edited by
                                #14

                                @Vijaykarthikeyan No, like shown in the documentation and the screenshot you posted: https://doc.qt.io/qt-6/qmake-variable-reference.html#includepath

                                https://forum.qt.io/topic/113070/qt-code-of-conduct

                                V 1 Reply Last reply 9 Jan 2024, 07:30
                                2
                                • J jsulm
                                  9 Jan 2024, 07:27

                                  @Vijaykarthikeyan No, like shown in the documentation and the screenshot you posted: https://doc.qt.io/qt-6/qmake-variable-reference.html#includepath

                                  V Offline
                                  V Offline
                                  Vijaykarthikeyan
                                  wrote on 9 Jan 2024, 07:30 last edited by
                                  #15

                                  @jsulm oh..yes..NOw I understood..Thank you

                                  1 Reply Last reply
                                  0
                                  • V Vijaykarthikeyan has marked this topic as solved on 18 Jan 2024, 05:39

                                  1/15

                                  8 Jan 2024, 11:34

                                  • Login

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