0

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

Cœur
  • 37,241
  • 25
  • 195
  • 267
APU
  • 239
  • 2
  • 17

1 Answers1

4

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
Bowdzone
  • 3,827
  • 11
  • 39
  • 52
  • What is the advantage of using Mingw than VS to compile Opencv? Crossplatform? Compatibility? – APU Jun 16 '15 at 12:02
  • @APU I'm no expert in this. But AFAIK there is no real benefit to it. Just maybe that if something compiles in `mingw`, it will most likely compile under linux as well (if the code itself is not os-dependent). But 99% of the vs-compatible code compiles under linux as well. – Bowdzone Jun 16 '15 at 12:05