Using Opencv with QT



  • I have integrated opencv in qt .
    added all in .pro file also.
    qt can find library of cv but i m getting linker error on building it.
    @
    (?release@Mat@cv@@QAEXXZ)
    detection.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall cv::VideoCapture::~VideoCapture(void)" (??1VideoCapture@cv@@UAE@XZ) referenced in function __unwindfunclet$?on_start_clicked@Detection@@AAEXXZ$0
    detection.obj : error LNK2019: unresolved external symbol "int __cdecl cv::waitKey(int)" (?waitKey@cv@@YAHH@Z) referenced in function "private: void __thiscall Detection::on_start_clicked(void)" (?on_start_clicked@Detection@@AAEXXZ)
    detection.obj : error LNK2019: unresolved external symbol "public: virtual bool __thiscall cv::VideoCapture::isOpened(void)const " (?isOpened@VideoCapture@cv@@UBE_NXZ) referenced in function "private: void __thiscall Detection::on_start_clicked(void)" (?on_start_clicked@Detection@@AAEXXZ)
    detection.obj : error LNK2019: unresolved external symbol "public: __thiscall cv::VideoCapture::VideoCapture(int)" (??0VideoCapture@cv@@QAE@H@Z) referenced in function "private: void __thiscall Detection::on_start_clicked(void)" (?on_start_clicked@Detection@@AAEXXZ)
    release\Detection.exe : fatal error LNK1120: 5 unresolved externals
    command failed with exit code 1120
    command failed with exit code 2
    The process "C:\Qt\qtcreator-2.3.1\bin\jom.exe" exited with code 2.
    Error while building project Detection (target: Desktop)
    When executing build step 'Make'
    @
    i am using opencv 2.0 and qt creator 2.3.1

    pls help me with this.



  • Can you post your .pro file?



  • #-------------------------------------------------

    Project created by QtCreator 2011-11-25T00:34:05

    #-------------------------------------------------

    QT += core gui

    TARGET = Detection
    TEMPLATE = app

    SOURCES += main.cpp
    detection.cpp

    HEADERS += detection.h

    FORMS += detection.ui
    INCLUDEPATH += C:\OpenCV2.0\include
    LIBS += -LC:\OpenCV2.0\lib
    -lopencv_core220
    -lopencv_highgui220
    -lopencv_imgproc220
    -lopencv_features2d220
    -lopencv_calib3d220



  • Use forward slashes in paths. \ is used as a separator for multiple entries.

    INCLUDEPATH += C:/OpenCV2.0/include

    LIBS += -LC:/OpenCV2.0/lib
    -lopencv_core220
    -lopencv_highgui220
    -lopencv_imgproc220
    -lopencv_features2d220
    -lopencv_calib3d220


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.