Opencv setup with Qt
-
wrote on 23 Jan 2015, 17:35 last edited by
Hello, I am trying to run opencv program on Qt Creator 3.2.0, i have built and installed opencv libraries using Cmake and Qt mingw 5.4, but when i include path and libraries in the .pro file of the project, it gives this error:
"C:\opencv-mingw\install\include\opencv2\core\core.hpp:49: error: C1083: Cannot open include file: 'opencv2/core/types_c.h': No such file or directory"Here is what i have included in the .pro of the project:
INCLUDEPATH += C:\opencv-mingw\install\javeria\opencv2
LIBS += -LC:\opencv-mingw\install\x64\mingw\binLIBS += -llibopencv_highgui2410
-llibopencv_imgproc2410
-llibopencv_objdetect2410 -
Hi,
Looks like the path to OpenCV's includes are in
@C:/opencv-mingw/install/include@
Also, please use the unix notation style for paths, otherwise you have to double your backslashes
-
wrote on 24 Jan 2015, 07:28 last edited by
The include part works but i cant declare a simple Mat object as it gives error while building like these:
main.obj:-1: error: LNK2019: unresolved external symbol "public: void __cdecl cv::Mat::deallocate(void)" (?deallocate@Mat@cv@@QEAAXXZ) referenced in function "public: void __cdecl cv::Mat::release(void)" (?release@Mat@cv@@QEAAXXZ) -
You are missing the OpenCV core library in your list of libraries to link to
-
wrote on 25 Jan 2015, 07:43 last edited by
This is the updated .pro file but its still giving same errors of unresolved externals:
win32
{
INCLUDEPATH += C:/opencv-mingw/install/include
LIBS += -LC:/opencv-mingw/install/x64/mingw/bin/libopencv_core2410.dll.a
LIBS += -LC:/opencv-mingw/install/x64/mingw/lib/libopencv_highgui2410.dll.a
LIBS += -LC:/opencv-mingw/install/x64/mingw/lib/libopencv_core2410.dll.a
LIBS += -LC:/opencv-mingw/install/x64/mingw/lib/libopencv_imgproc2410.dll.a
} -
Your original pro file was correct, just missing the opencv_core2410 library.
Now you are using the wrong l, L is for giving an additionnal path to the linker to search for libraries -
wrote on 25 Jan 2015, 17:29 last edited by
I followed your instruction but now it says it can find for example "opencv_highgui.lib", is there something still missing?
-
wrote on 25 Jan 2015, 17:39 last edited by
So here is my finalized .pro file I have also added dll of bin too:
win32 {
INCLUDEPATH += "C:/opencv/build/include" \LIBS += -L"C:/opencv/build/x86/vc12/lib" \ -lopencv_core2410d \ -lopencv_highgui2410d \ -lopencv_imgproc2410d \ -lopencv_features2d2410d \ -lopencv_calib3d2410d LIBS += -L"C:/opencv/build/x86/vc12/bin" \ -lopencv_core2410d \ -lopencv_highgui2410d \ -lopencv_imgproc2410d \ -lopencv_features2d2410d \ -lopencv_calib3d2410d
}
It still gives unresolved external symbols error -
wrote on 14 Nov 2016, 05:46 last edited by
So, anyone has succeeded in configuring opencv with Qt on Windows? I am using VS2013, and I found a demo for mingw, but an adjustment for vs just doesn't work well. It is always complaining about "No such file or directory" for including file:
C:\Users\vvv\Documents\github\OpenCV-With-QT-Quick-Demo\dialog.h:6: error: C1083: Cannot open include file: 'opencv2/core/core.hpp': No such file or directory
So frustrating tuned a whole morning without avail. Please show a working one.
-
wrote on 14 Nov 2016, 06:07 last edited by
Using OpenCV on Win for an app that do scene change detection based on threshold, OpenCV 3, compiled tonight OpenCV 2.x and also work fine.
Bottom line OpenCV do work correctly, with is not a surprise, with Qt.
-
So, anyone has succeeded in configuring opencv with Qt on Windows? I am using VS2013, and I found a demo for mingw, but an adjustment for vs just doesn't work well. It is always complaining about "No such file or directory" for including file:
C:\Users\vvv\Documents\github\OpenCV-With-QT-Quick-Demo\dialog.h:6: error: C1083: Cannot open include file: 'opencv2/core/core.hpp': No such file or directory
So frustrating tuned a whole morning without avail. Please show a working one.
wrote on 14 Nov 2016, 06:17 last edited by boydcheung@boydcheung okay, this vid here gives a clue. Run Qmake before debugging.