Opencv precompiled mingw binaries with qt?

Hello there. I recently discovered that qt had good GUI systems at worked well with opencv. Naturally I rushed to try it. I discovered that there were even precompiled libraries and binaries for mingw. Now, considering the fact that I have never used qt before, I just did what the last parts of the tutorials said (the parts after cmaking the libraries and building them). Unfortunately, the qt environment cannot find the library files. It says it cannot find the libraries hat I am including and that they do not exist. ( I have had this problem with visual studio too but I resolved it with proper path declaration)

As far as I understood I had only to include the bin folder in the system path and then add the libs and include paths. I obviously replaced their directories with their equivalents in my system, and I replaced 231 in each include with 245. Now, is there anything that I missed? Is it absolutely imperative that I compile from source to make it work? I would appreciate any light anyone can shed on the matter.

edit retag close merge delete

Sort by » oldest newest most voted

Assuming that you have OpenCV installed from Pre-built Libraries (as explained here) and OpenCV enviroment variable set (as explained here) you have to change OPENCV_DIR value to path to "build" subdirectory of directory where opencv was extracted i.e. :

C:\opencv\build


Remove from PATH entry (because it is not longer valid):

%OPENCV_DIR%\bin


%OPENCV_DIR%;%OPENCV_DIR%/x86/mingw/bin


If you use cmake for creating Qt projects, your project folder should contain file CMakeLists.txt which should contain following entries:

find_package(OpenCV REQUIRED)