MinGW is a collection of freely available and freely distributable Windows specific header files and import libraries, augmenting the GNU Compiler Collection, (GCC), and its associated tools, (GNU binutils). MinGW provides a complete Open Source programming tool set which is suitable for the development of native Windows programs that do not depend on any 3rd-party C runtime DLLs.

Compile OpenCV under MinGW.

MinGW can be used on its own but it is also the "favorite" compiler of the following IDE's:

Tp use MinGW, it is recommended to follow the steps in the CodeBlocks page. But to use MinGW by itself, you can also try these older methods:

OpenCV 2.0 and 2.1

Release package

OpenCV 2.0 and 2.1 are distributed as a package fromsourceforge

Note: This package is only in Release mode (if you want to have the Debug configuration you need to compile it)

Compilation

With its new c++ interface OpenCV needs GCC 4.x (Since version 1.1.0).

You need to download and install MinGW:

Once the installation is done, you can look at the InstallGuide to continue the compilation.

After compilation you need to be sure that you link with the generatedlibcv*.a(static version of shared library), and that yourlibcv*.dllare in thePATH.

Note: You can have in the same folder the *.dll for MinGW, MSVC and OpenCV 1.0.0. However you need to be sure to not mix them during the linking.

Tips

TBB library with MinGW

Since version 2.1, OpenCV use the TBB library to support parallel processing:

To build OpenCV with TBB under MinGW. You should compiled TBB sources with the following command:

make compiler=gcc arch=ia32 runtime=mingw tbb

Then you should set :

Known Bug specific to MinGW

https://code.ros.org/trac/opencv/query?col=id&col=summary&col=type&col=status&col=priority&col=component&col=version&order=priority&summary=~MinGW

Building on Windows using MinGW 3.4.5


OpenCV 1.0

First, you need to download the official release of MinGW at sourceforge.net

You can use directly the win32 binary package (*.dll and *.lib) because C code compile under Microsoft Visual Studio is compatible with MinGW.

However, the VideoSurveillance part can not be used as it include c++ code.

OpenCVWiki: MinGW (last edited 2012-07-21 05:43:44 by ShervinEmami)