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. OpenCV: No such file or directory
Forum Updated to NodeBB v4.3 + New Features

OpenCV: No such file or directory

Scheduled Pinned Locked Moved Unsolved General and Desktop
11 Posts 4 Posters 2.6k 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.
  • Z zzzKennYzzz

    Hello, a lot of problems arose when installing OpenCV on Ubuntu to work in QtCreator, but they were somehow solved and now the time has come to test this library in QtCreator. And here again the error, which I can no longer understand how to solve, maybe someone faced this problem? (screenshots of the problem are attached)

    Perhaps Qt cannot access the files, but I can’t know for sure, I also attached screenshots of the folders (from 3 picture)

    LfltHfR_jDP-qYRmmrM8z6-r_lf_GenLvTPVOIuVRXxW863yxnJcZLhru-Sjd8CuoZrRCt15ISYgQw6PILu6VFgb.jpg
    eCdIMbh0RXo32OdIVHBEXrgkR0KL4XiuAeXNReJuwau0vj6WsPQNkaFdVHZeIEmmOM4POIky3GwQ1t-7iAehmxFT.jpg
    Km6-xqUqloJ38soK56tOn6JkervSYwoZS8lNeBLr4Gudcl_RbHwmCpHl3ar9jvT_-Le_9c_IF-OivcqU7MwrKT1f.jpg
    tv8gw6R159dM88J96YZ3IjQw_irs5gyOoygZkFXKEzeqEr72x9EheHI2qG-Zofvct5Xj2zaMwQA9FsGpFzSV3E53.jpg
    GWR_42O6ttap4KwdpKEiw2B6M-W3cGeKzl9VPLZgG-iytUuVuURMgOd3FsI2kXBOGivpyeCxD4xKMiFvQYMVQlVH.jpg

    JonBJ Offline
    JonBJ Offline
    JonB
    wrote on last edited by JonB
    #2

    @zzzKennYzzz
    Since you have the /.../opencv4/opencv2 directory on your INCLUDEPATH, remove the leading opencv4/opencv2/ from the #include <opencv4/opencv2/...> directives.

    If that is not it, find out whether the file mentioned in the error message exists in that include directory or anywhere.

    Z 1 Reply Last reply
    1
    • JonBJ JonB

      @zzzKennYzzz
      Since you have the /.../opencv4/opencv2 directory on your INCLUDEPATH, remove the leading opencv4/opencv2/ from the #include <opencv4/opencv2/...> directives.

      If that is not it, find out whether the file mentioned in the error message exists in that include directory or anywhere.

      Z Offline
      Z Offline
      zzzKennYzzz
      wrote on last edited by
      #3

      @JonB
      Unfortunately it didn't help me. Maybe he is trying to immediately access the file in "core.hpp" without accessing the folder "core"?
      f8c8a59d-05af-4532-b465-bfff4e4af8cf-image.png

      1 Reply Last reply
      0
      • JoeCFDJ Offline
        JoeCFDJ Offline
        JoeCFD
        wrote on last edited by JoeCFD
        #4

        add all of them
        INCLUDEPATH += /usr/local/include/opencv4/opencv2
        DEPENDPATH += /usr/local/include/opencv4/opencv2

        INCLUDEPATH += /usr/local/include/opencv4/opencv2/core
        DEPENDPATH += /usr/local/include/opencv4/opencv2/core

        INCLUDEPATH += /usr/local/include/opencv4/opencv2/highgui
        DEPENDPATH += /usr/local/include/opencv4/opencv2/highgui

        simply include header files in any cpp file
        #include "core.hpp"

        Z 1 Reply Last reply
        0
        • JoeCFDJ JoeCFD

          add all of them
          INCLUDEPATH += /usr/local/include/opencv4/opencv2
          DEPENDPATH += /usr/local/include/opencv4/opencv2

          INCLUDEPATH += /usr/local/include/opencv4/opencv2/core
          DEPENDPATH += /usr/local/include/opencv4/opencv2/core

          INCLUDEPATH += /usr/local/include/opencv4/opencv2/highgui
          DEPENDPATH += /usr/local/include/opencv4/opencv2/highgui

          simply include header files in any cpp file
          #include "core.hpp"

          Z Offline
          Z Offline
          zzzKennYzzz
          wrote on last edited by
          #5

          @JoeCFD
          Doesn't work =(

          0eb5bb5d-1bd2-481c-b4d2-03e1ffaa7d57-image.png

          1 Reply Last reply
          0
          • JoeCFDJ Offline
            JoeCFDJ Offline
            JoeCFD
            wrote on last edited by
            #6

            locate cvdef.h

            Z 1 Reply Last reply
            0
            • JoeCFDJ JoeCFD

              locate cvdef.h

              Z Offline
              Z Offline
              zzzKennYzzz
              wrote on last edited by zzzKennYzzz
              #7

              @JoeCFD
              It there
              maybe access problems?

              f8caaf99-92b1-48c5-9482-437653e63286-image.png

              1 Reply Last reply
              0
              • JoeCFDJ Offline
                JoeCFDJ Offline
                JoeCFD
                wrote on last edited by
                #8

                @JoeCFD said in OpenCV: No such file or directory:

                add all of them
                INCLUDEPATH += /usr/local/include/opencv4/opencv2
                DEPENDPATH += /usr/local/include/opencv4/opencv2

                add all of them
                INCLUDEPATH += /usr/local/include/opencv4
                DEPENDPATH += /usr/local/include/opencv4

                Z 1 Reply Last reply
                1
                • JoeCFDJ JoeCFD

                  @JoeCFD said in OpenCV: No such file or directory:

                  add all of them
                  INCLUDEPATH += /usr/local/include/opencv4/opencv2
                  DEPENDPATH += /usr/local/include/opencv4/opencv2

                  add all of them
                  INCLUDEPATH += /usr/local/include/opencv4
                  DEPENDPATH += /usr/local/include/opencv4

                  Z Offline
                  Z Offline
                  zzzKennYzzz
                  wrote on last edited by
                  #9

                  @JoeCFD
                  Thank you! But now the new problem

                  742e26e7-4d2d-4f1b-9c28-6e5748df0614-image.png

                  however, they are there

                  9c49d8cb-8ac6-4f33-b5ea-ce4e05d1ef7a-image.png

                  1 Reply Last reply
                  0
                  • JoeCFDJ Offline
                    JoeCFDJ Offline
                    JoeCFD
                    wrote on last edited by
                    #10

                    from command line:
                    locate libopencv_contrib or locate opencv_contrib
                    to find where it is located. Then in your pro file add
                    LIBS += -Lpathtoopencv_contrib -lopencv_contrib

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

                      Hi,

                      Using:

                      CONFIG += link_pkgconfig
                      PKGCONFIG += opencv
                      

                      Should be enough

                      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

                      • Login

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