I regularly use Code::Blocks and MinGW for my C/C++ projects. I would like to be able to use OpenCV, since it has a nice library for computer vision projects. They have dropped support for MinGW. I have heard you can build it on your own somehow, but I have no experience doing this with 3rd party libraries. Can someone explain how to build it in a simple way for MinGW?
1 Answer
There is, or at least there was at least until 2.4.6, precompiled version of opencv that works out of the box with mingw as long as you use the dw2(standard) version of mingw.
since i needed sjlj support i had to build my own version of openCV 2.4.6 I did he following - i am pretty sure it will work for the current openCV version as well
- Setup your preferred Mingw Environment - i would strongly recommend to use gcc 4.5 or newer
- Intstall Msys
- Intall Cmake - you can get a binary package
- Start the Cmake GUI
- Select the openCV source folder
- Click Configure and select MSYS-Makfiles
- Errors in the first run of Configure might be resolved if you run Configure again
- Click Generate
- use MSYS
maketo run the generatedmakefile - Copy all desired libraries and include files to your mingw-installation or your project