user3476738
user3476738

Reputation: 186

How do I set up OpenCV for MinGW project?

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?

Upvotes: 2

Views: 339

Answers (1)

baxit
baxit

Reputation: 242

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

  1. Setup your preferred Mingw Environment - i would strongly recommend to use gcc 4.5 or newer
  2. Intstall Msys
  3. Intall Cmake - you can get a binary package
  4. Start the Cmake GUI
  5. Select the openCV source folder
  6. Click Configure and select MSYS-Makfiles
  7. Errors in the first run of Configure might be resolved if you run Configure again
  8. Click Generate
  9. use MSYS make to run the generated makefile
  10. Copy all desired libraries and include files to your mingw-installation or your project

Upvotes: 1

Related Questions