I recently downloaded and built opencv in my 64-bit Windows machine using cmake
. All the binaries are included in the install
folder and it contains only the folders as shown below:
I don't know how to config cmake to produce binaries for x86. I'm asking this, because I'm using Qt Creator 32bit with MinGW and I'm getting problems while linking and compiling the code. What's the proper way to do the build? I'm using mingw
compiler suite.
Note: The downloaded package contains the pre-built binaries for x86
but there are none for MinGW, but only for Visual Studio.
Steps for mingw from with
cmake-gui
from this guide. We could also do this easily on command prompt withcmake
and-m32
option. But usingcmake-gui
will give you more idea about the options available for opencv configuration and bring you in better position if you want to customize opencv build tomorrow ( like enabling java wrapper or OpenCL etc ).Set
source path
to downloaded opencv directory andbuild path
to your choice as in imageClick
Configure
button and specify generator as mingw makefiles as in imageFinish
button.An options page will be listed.
5.1. Edit
CMAKE_INSTALL_PREFIX
to change the install location if you want to.5.2. Select
ENABLE_CXX11
if it isn't already selected.5.3. Change other options only if you are familiar with them. Then click
Configure
again and then click 'Generate` to generate make files.Modify
opencv\sources\modules\videoio\src\cap_dshow.cpp
and add this define at the top of the file:In command prompt( at build path ) type
mingw32-make
( addmingw32-make
folder toPATH
if required )mingw32-make install