Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Learning
  3. Qt in Education
  4. Qt problem to include opencv library
Qt 6.11 is out! See what's new in the release blog

Qt problem to include opencv library

Scheduled Pinned Locked Moved Qt in Education
5 Posts 3 Posters 5.8k 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.
  • B Offline
    B Offline
    Bekhouche
    wrote on last edited by
    #1

    Hello,

    I have Qt 5.2.1 Windows & vs11 compiler (x86), this is my .pro file :
    @
    SOURCES = facerecognitiondemo.cpp main.cpp
    HEADERS = facerecognitiondemo.h
    FORMS = facerecognitiondemo.ui

    target.path = $$[QT_INSTALL_EXAMPLES]/uitools/FaceRecognitionDemo
    INSTALLS += target

    QT += widgets

    OPENCV_PATH = E:\opencv

    LIBS_PATH = "$$OPENCV_PATH/build/x86/vc11/lib"

    CONFIG(debug, debug|release) {
    LIBS     += -L$$LIBS_PATH \
                -lopencv_core246d \
                -lopencv_highgui246d \
                -lopencv_objdetect246d
    }
    
    CONFIG(release, debug|release) {
    LIBS     += -L$$LIBS_PATH \
                -lopencv_core246 \
                -lopencv_highgui246 \
                -lopencv_objdetect246
    }
    

    @
    When i build i get this error :
    E:\Qt\qt5.2.1\Tools\qtcreator\bin\facerecognitiondemo\frdb.h:9: error: C1083: Cannot open include file: 'opencv/cxcore.h': No such file or directory

    1 Reply Last reply
    0
    • H Offline
      H Offline
      hpollak
      wrote on last edited by
      #2

      you should add

      @INCLUDEPATH += $$OPENCV_PATH/src/include@

      maybe src is not needed, take a look in the directory where to find:

      "opencv/cxcore.h"

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Bekhouche
        wrote on last edited by
        #3

        [quote author="hpollak" date="1395215900"]you should add

        @INCLUDEPATH += $$OPENCV_PATH/src/include@

        maybe src is not needed, take a look in the directory where to find:

        "opencv/cxcore.h"

        [/quote]
        it's not working this is the full path
        @E:\opencv\build\include\opencv@

        1 Reply Last reply
        0
        • B Offline
          B Offline
          Bekhouche
          wrote on last edited by
          #4

          Qt 5.2.1
          this is the full project
          https://www.dropbox.com/s/hmbl3e8hj7ygq4a/FaceRecognitionDemo.rar
          and this is the opencv directories (opencv 2.4.8 windows):
          E:\opencv\build
          E:\opencv\sources

          1 Reply Last reply
          0
          • A Offline
            A Offline
            andreyc
            wrote on last edited by
            #5

            In you project file you put
            @
            INCLUDEPATH += E:\opencv\build\include
            @

            And in you sources you use
            @
            #include <cxcore.h>
            @

            You should change either INCLUDEPATH
            @
            INCLUDEPATH += E:\opencv\build\include\opencv
            @

            or #include directive
            @
            #include <opencv/cxcore.h>
            @

            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