Ask Your Question

Opencv precompiled mingw binaries with qt?

asked 2013-06-01 01:08:15 -0600

Hypnotoad gravatar image

updated 2013-06-01 01:09:15 -0600

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)

the tutorial I mainly used was this one.

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 flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2013-06-02 12:28:28 -0600

mat gravatar image

updated 2013-06-02 20:47:08 -0600

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. :


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


and add:


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)
target_link_libraries(YourProjectName ${OpenCV_LIBRARIES})
edit flag offensive delete link more

Question Tools


Asked: 2013-06-01 01:08:15 -0600

Seen: 3,421 times

Last updated: Jun 02 '13