Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Cannot open include file: 'opencv2/opencv.hpp': No such file or directory
Forum Updated to NodeBB v4.3 + New Features

Cannot open include file: 'opencv2/opencv.hpp': No such file or directory

Scheduled Pinned Locked Moved Unsolved General and Desktop
10 Posts 3 Posters 12.7k Views 2 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.
  • F Offline
    F Offline
    Faisal_Ali
    wrote on last edited by
    #1

    Hi
    i link opencv with qt creator 5.7. When i include header file "#include<opencv2/opencv.hpp>" it give error.I try but i cant find any solution...

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

      Hi and welcome to devnet,

      Did you add the folder where the opencv2 include directory can found to INCLUDEPATH ?

      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
      1
      • F Offline
        F Offline
        Faisal_Ali
        wrote on last edited by
        #3

        Thanks for reply..
        Yes i include the folder "opencv2"
        INCLUDEPATH +=C:\opencv\build\include

        jsulmJ 2 Replies Last reply
        0
        • F Faisal_Ali

          Thanks for reply..
          Yes i include the folder "opencv2"
          INCLUDEPATH +=C:\opencv\build\include

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Faisal_Ali Does C:\opencv\build\include contain opencv2/opencv.hpp ?

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

          F 1 Reply Last reply
          1
          • F Faisal_Ali

            Thanks for reply..
            Yes i include the folder "opencv2"
            INCLUDEPATH +=C:\opencv\build\include

            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #5

            @Faisal_Ali You should use / instead of \ in pro files.

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

            1 Reply Last reply
            0
            • jsulmJ jsulm

              @Faisal_Ali Does C:\opencv\build\include contain opencv2/opencv.hpp ?

              F Offline
              F Offline
              Faisal_Ali
              wrote on last edited by
              #6

              @jsulm
              yes "include" folder contain opencv2/opencv.hpp

              jsulmJ 1 Reply Last reply
              0
              • F Faisal_Ali

                @jsulm
                yes "include" folder contain opencv2/opencv.hpp

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @Faisal_Ali What about my other comment: using / instead of \ in INCLUDEPATH +=C:\opencv\build\include ?

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

                F 1 Reply Last reply
                0
                • jsulmJ jsulm

                  @Faisal_Ali What about my other comment: using / instead of \ in INCLUDEPATH +=C:\opencv\build\include ?

                  F Offline
                  F Offline
                  Faisal_Ali
                  wrote on last edited by
                  #8

                  @jsulm i change it but not solve my error

                  jsulmJ 1 Reply Last reply
                  0
                  • F Faisal_Ali

                    @jsulm i change it but not solve my error

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #9

                    @Faisal_Ali Did you run qmake again after the change in pro file? So, run qmake and do a rebuild.
                    If it still does not work then please paste the compiler call so we can see which include directories were passed to the compiler.

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

                    F 1 Reply Last reply
                    1
                    • jsulmJ jsulm

                      @Faisal_Ali Did you run qmake again after the change in pro file? So, run qmake and do a rebuild.
                      If it still does not work then please paste the compiler call so we can see which include directories were passed to the compiler.

                      F Offline
                      F Offline
                      Faisal_Ali
                      wrote on last edited by
                      #10

                      @jsulm Thanks Brother And I was About to cry Because of This Error
                      found on many Places But it wasn't Fruit full
                      Best regards
                      Faisal Ali

                      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