Can't run Qt program connected with OpenCV
-
When I run program on QT creator, simple program which uses OpenCV.
Have an error: cannot open file 'opencv243d.lib' (file not found)Here is my pro file.
INCLUDEPATH += C:\Opencv243\opencv\build\include
INCLUDEPATH += C:\opencv243\opencv\build\include\opencv2LIBS += -LC:\Opencv243\opencv_bin\lib
-lopencv_core243d
-lopencv_highgui243d
-lopencv_imgproc243d
-lopencv_features2d243d
-lopencv_calib3d243d
-lopencv_video243d
-lopencv_objdetect243d
-lopencv_ml243d
-lopencv_legacy243d
-lopencv_imgproc243d
-lopencv_flann243d
-lopencv_gpu243dPlease help me.
-
I have my pro file and a lot of errors:!http://s2.ipicture.ru/uploads/20130210/UC1y2SXv.jpg(http://s2.ipicture.ru/uploads/20130210/UC1y2SXv.jpg)!
-
pro-file:
QT += core guigreaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = Eye1
TEMPLATE = appSOURCES += main.cpp
dialog.cppHEADERS += dialog.h
FORMS += dialog.ui
win32:CONFIG(release, debug|release): LIBS += -L$$PWD/../../Opencv243/opencv/build/x64/vc10/lib/ -lopencv_core243d -lopencv_highgui243d -lopencv_imgproc243d -lopencv_features2d243d -lopencv_calib3d243d -lopencv_video243d -lopencv_objdetect243d -lopencv_ml243d -lopencv_legacy243d -lopencv_imgproc243d -lopencv_flann243d -lopencv_gpu243d
else:win32:CONFIG(debug, debug|release): LIBS += -L$$PWD/../../Opencv243/opencv/build/x64/vc10/lib/ -lopencv_core243d -lopencv_highgui243d -lopencv_imgproc243d -lopencv_features2d243d -lopencv_calib3d243d -lopencv_video243d -lopencv_objdetect243d -lopencv_ml243d -lopencv_legacy243d -lopencv_imgproc243d -lopencv_flann243d -lopencv_gpu243dINCLUDEPATH += $$PWD/../../Opencv243/opencv/build/include
DEPENDPATH += $$PWD/../../Opencv243/opencv/build/includeErrors:
dialog.obj:-1: ошибка: LNK2019: unresolved external symbol "public: virtual __thiscall cv::VideoCapture::~VideoCapture(void)" (??1VideoCapture@cv@@UAE@XZ) referenced in function "public: virtual __thiscall Dialog::~Dialog(void)" (??1Dialog@@UAE@XZ)dialog.obj:-1: ошибка: LNK2019: unresolved external symbol "public: __thiscall cv::VideoCapture::VideoCapture(void)" (??0VideoCapture@cv@@QAE@XZ) referenced in function "public: __thiscall Dialog::Dialog(class QWidget *)" (??0Dialog@@QAE@PAVQWidget@@@Z)
-
My OpenCV version is 2.4.6, to include the PATHs and LIBS I did the code as follows, to this version of OpenCV you don't have to use the Cmake to compile the files, just add according to your system. Try to adapt the code to suit your situation.
@QT += core
QT -= gui
TARGET = ShowImage
CONFIG += console
CONFIG -= app_bundleTEMPLATE = app
SOURCES += main.cpp
INCLUDEPATH += C:\opencv\build\include
INCLUDEPATH += C:\opencv\includeLIBS += -LC:\opencv\build\x86\vc11\lib
-lopencv_calib3d246d
-lopencv_contrib246d
-lopencv_core246d
-lopencv_features2d246d
-lopencv_flann246d
-lopencv_gpu246d
-lopencv_haartraining_engined
-lopencv_highgui246d
-lopencv_imgproc246d
-lopencv_legacy246d
-lopencv_ml246d
-lopencv_nonfree246d
-lopencv_objdetect246d
-lopencv_photo246d
-lopencv_stitching246d
-lopencv_superres246d
-lopencv_ts246d
-lopencv_video246d
-lopencv_videostab246d@Hope that Helps!