Ask Your Question

OpenCV 3.1 with Contrib modules for Python - MinGW and Codelite on Windows

asked 2016-03-15 06:01:10 -0500

I have spent a week trying to compile Open CV with contrib modules for research and it has been a nightmare...

I am using cmake 3.5.0 to compile from opencv/sources. In the opencv folder I added the contrib modules and after cmake configures, I set the extra module path as opencv/contrib/modules.

Then after the files have been compiled for Codelite - MinGW, I have tried to build the OpenCV.project and the OpenCV.workspace.

Both of these end with mingw32-make.exe: * [all] Error 2

I have tried two PCs compiling, I have tried codeblocks, eclipse, codelite, VS2015 and all of them have failed - however I get the furthest in building with codelite so I will stick with this.

Here is the cmake log before adding the contrib files -

Here is the cmake log for after -

Here is the build log for building the opencv.project -

At this point I would like to give up but I do not know of any other packages with opencv functionality...

I have on separate cmakes, built both the entire workspace and built the individual opencv.project, when I build the full workspace, for each individual file it does pretty much the same thing. Always the same error.

Here are my environment variables C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Windows Live\Shared;C:\Program Files (x86)\QuickTime\QTSystem\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\TortoiseGit\bin;C:\Anaconda;C:\Anaconda\Scripts;C:\Anaconda\Library\bin;C:\MinGW\bin;C:\Program Files (x86)\CMake\bin;c:/MinGW/bin

Just incase someone points out that one is missing...



p.s I have virutally no other experience with cmake, so if I need to change some variables I will need some instructions on how to do it on windows - thanks!

edit retag flag offensive close merge delete


Just as a side note, would it be better to use the python 3.5 build with contrib folders from ? I have no experience with 3.5 but if this contains the fullest set of modules I will try this

Ionwaffle gravatar imageIonwaffle ( 2016-03-15 07:05:00 -0500 )edit

^^ forget that idea. those libs are unfortunately linked against dynamically build opencv libs, and those libs are not redistributed (so, worthless, imho)

berak gravatar imageberak ( 2016-03-15 07:50:23 -0500 )edit

I managed to get them working via this method, if the code is being run on just one machine for data collection, is it really that bad? I am not making anything to be distributed


Ionwaffle gravatar imageIonwaffle ( 2016-03-15 08:01:33 -0500 )edit

ok, sorry. things have obviously changed, and i wasn't aware of it.

berak gravatar imageberak ( 2016-03-15 08:30:49 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2016-03-18 08:27:55 -0500

mshabunin gravatar image

updated 2016-03-18 08:35:10 -0500

Try to use MinGW-w64 instead of outdated MinGW.

You can also disable problematic modules: pass -DBUILD_opencv_dnn=OFF option to cmake.

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2016-03-15 06:01:10 -0500

Seen: 655 times

Last updated: Mar 18 '16