Must compile Opencv with Mingw in order to use in QT under Windows?

503 Views Asked by At

I've visit these blogs

https://zahidhasan.wordpress.com/2014/08/19/qt-5-3-1-64-bit-mingw-windows/
How to link opencv in QtCreator and use Qt library
http://www.cnblogs.com/grandyang/p/4328896.html

All of them are using Mingw to compile Opencv through Cmake. If I want to use Opencv in QT, is compiling with Mingw the only way?

I have this question because I already compiled my Opencv 2.4.11 with Visual Studio 2013(in Cmake---Visual Studio 12 2013 Win64), when I follow the directions setting up the INCLUDEPATH and LIBS in QT

"C:\\opencv2.4.11\\opencv\\build\\include\\opencv"
"C:\\opencv2.4.11\\opencv\\build\\include\\opencv2"

-L"C:\\opencv2.4.11\\opencv\\build\\x64\\vc12\\lib" \
    -lopencv_core2411 \
    -lopencv_highgui2411 \
    -lopencv_imgproc2411 \
    -lopencv_features2d2411 \
    -lopencv_calib3d2411 \

I get this error message:

C1083:Cannot open include file:'opencv2/opencv.hpp': No such file or directory

1

There are 1 best solutions below

2
On BEST ANSWER

You can compile it with Visual Studio as well. The opencv includepaths already have the opencv2 part of it. So the correct includepath would only be:

C:\\opencv2.4.11\\opencv\\build\\include