title: Problems with building opencv 2.3.1, 2.4.2 and 2.4.3, on Windows 7 using MinGW
body: <p>Last few days I am struggling with installation OpenCV 2.3.1 on Windows using MinGW compiler. First I've tried newest version 2.4.3 and 2.4.2 but same problem occured. Then I tried older version 2.3.1 but still.</p>
  
  <p>Actually I followed these instructions <a href="http://www.pansenti.com/wordpress/?page_id=174" rel="nofollow">http://www.pansenti.com/wordpress/?page_id=174</a> Everything went smooth until building with MinGW. Here is my console output </p>
  
  <pre><code>C:\OpenCV-2.3.1\opencv\cmake-release&gt;C:\MinGW\bin\mingw32-make.exe install
  Scanning dependencies of target libjpeg
  [  0%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jcapimin.obj
  [  0%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jcapistd.obj
  [  0%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jccoefct.obj
  [  1%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jccolor.obj
  [  1%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jcdctmgr.obj
  [  1%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jchuff.obj
  [  1%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jcinit.obj
  [  1%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jcmainct.obj
  [  2%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jcmarker.obj
  [  2%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jcmaster.obj
  [  2%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jcomapi.obj
  [  2%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jcparam.obj
  [  2%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jcphuff.obj
  [  2%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jcprepct.obj
  [  3%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jcsample.obj
  [  3%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jctrans.obj
  [  3%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jdapimin.obj
  [  3%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jdapistd.obj
  [  3%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jdatadst.obj
  [  4%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jdatasrc.obj
  [  4%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jdcoefct.obj
  [  4%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jdcolor.obj
  [  4%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jddctmgr.obj
  [  4%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jdhuff.obj
  [  4%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jdinput.obj
  [  5%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jdmainct.obj
  [  5%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jdmarker.obj
  [  5%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jdmaster.obj
  [  5%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jdmerge.obj
  [  5%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jdphuff.obj
  [  5%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jdpostct.obj
  [  6%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jdsample.obj
  [  6%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jdtrans.obj
  [  6%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jerror.obj
  [  6%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jfdctflt.obj
  [  6%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jfdctfst.obj
  [  7%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jfdctint.obj
  [  7%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jidctflt.obj
  [  7%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jidctfst.obj
  [  7%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jidctint.obj
  [  7%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jidctred.obj
  [  7%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jmemansi.obj
  [  8%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jmemmgr.obj
  [  8%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jquant1.obj
  [  8%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jquant2.obj
  [  8%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/jutils.obj
  [  8%] Building C object 3rdparty/libjpeg/CMakeFiles/libjpeg.dir/transupp.obj
  Linking C static library ..\lib\libjpeg.lib
  [  8%] Built target libjpeg
  Scanning dependencies of target zlib
  [  8%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/adler32.obj
  [  8%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/compress.obj
  [  8%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/crc32.obj
  [  9%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/deflate.obj
  [  9%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/gzclose.obj
  [  9%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/gzlib.obj
  C:\OpenCV-2.3.1\opencv\3rdparty\zlib\gzlib.c: In function 'gz_error':
  C:\OpenCV-2.3.1\opencv\3rdparty\zlib\gzlib.c:518:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes]
  [  9%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/gzread.obj
  [  9%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/gzwrite.obj
  [  9%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/infback.obj
  [ 10%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/inffast.obj
  C:\OpenCV-2.3.1\opencv\3rdparty\zlib\inffast.c: In function 'inflate_fast':
  C:\OpenCV-2.3.1\opencv\3rdparty\zlib\inffast.c:324:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes]
  [ 10%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/inflate.obj
  [ 10%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/inftrees.obj
  C:\OpenCV-2.3.1\opencv\3rdparty\zlib\inftrees.c: In function 'inflate_table':
  C:\OpenCV-2.3.1\opencv\3rdparty\zlib\inftrees.c:330:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes]
  [ 10%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/trees.obj
  C:\OpenCV-2.3.1\opencv\3rdparty\zlib\trees.c:1244:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes]
  C:\OpenCV-2.3.1\opencv\3rdparty\zlib\trees.c:1244:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes]
  C:\OpenCV-2.3.1\opencv\3rdparty\zlib\trees.c: In function '_tr_init':
  C:\OpenCV-2.3.1\opencv\3rdparty\zlib\trees.c:410:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes]
  C:\OpenCV-2.3.1\opencv\3rdparty\zlib\trees.c: In function '_tr_stored_block':
  C:\OpenCV-2.3.1\opencv\3rdparty\zlib\trees.c:883:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes]
  C:\OpenCV-2.3.1\opencv\3rdparty\zlib\trees.c: In function '_tr_align':
  C:\OpenCV-2.3.1\opencv\3rdparty\zlib\trees.c:919:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes]
  C:\OpenCV-2.3.1\opencv\3rdparty\zlib\trees.c: In function '_tr_flush_block':
  C:\OpenCV-2.3.1\opencv\3rdparty\zlib\trees.c:1020:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes]
  C:\OpenCV-2.3.1\opencv\3rdparty\zlib\trees.c: In function '_tr_tally':
  C:\OpenCV-2.3.1\opencv\3rdparty\zlib\trees.c:1071:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes]
  [ 10%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/uncompr.obj
  [ 11%] Building C object 3rdparty/zlib/CMakeFiles/zlib.dir/zutil.obj
  C:\OpenCV-2.3.1\opencv\3rdparty\zlib\zutil.c: In function 'zcalloc':
  C:\OpenCV-2.3.1\opencv\3rdparty\zlib\zutil.c:308:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes]
  C:\OpenCV-2.3.1\opencv\3rdparty\zlib\zutil.c: In function 'zcfree':
  C:\OpenCV-2.3.1\opencv\3rdparty\zlib\zutil.c:316:1: warning: visibility attribute not supported in this configuration; ignored [-Wattributes]
  Linking C static library ..\lib\zlib.lib
  [ 11%] Built target zlib
  Scanning dependencies of target opencv_core
  [ 11%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/alloc.obj
  [ 11%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/arithm.obj
  [ 11%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/array.obj
  [ 11%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/cmdparser.obj
  [ 11%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/convert.obj
  [ 12%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/copy.obj
  [ 12%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/datastructs.obj
  [ 12%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/drawing.obj
  [ 12%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/dxt.obj
  [ 12%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/lapack.obj
  [ 12%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/mathfuncs.obj
  [ 13%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/matmul.obj
  [ 13%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/matop.obj
  [ 13%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/matrix.obj
  [ 13%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/out.obj
  [ 13%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/persistence.obj
  [ 14%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/precomp.obj
  [ 14%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/rand.obj
  [ 14%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/stat.obj
  [ 14%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/system.obj
  [ 14%] Building CXX object modules/core/CMakeFiles/opencv_core.dir/src/tables.obj
  Linking CXX shared library ..\..\bin\opencv_core231.dll
  [ 14%] Built target opencv_core
  Scanning dependencies of target opencv_imgproc
  [ 14%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/accum.obj
  [ 14%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/approx.obj
  [ 14%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/canny.obj
  [ 14%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/color.obj
  [ 14%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/contours.obj
  [ 15%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/convhull.obj
  [ 15%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/corner.obj
  [ 15%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/cornersubpix.obj
  [ 15%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/deriv.obj
  [ 15%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/distransform.obj
  [ 16%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/emd.obj
  [ 16%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/featureselect.obj
  [ 16%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/featuretree.obj
  [ 16%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/filter.obj
  [ 16%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/floodfill.obj
  [ 16%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/geometry.obj
  [ 17%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/grabcut.obj
  [ 17%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/histogram.obj
  [ 17%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/hough.obj
  [ 17%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/imgwarp.obj
  [ 17%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/inpaint.obj
  [ 17%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/kdtree.obj
  [ 18%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/linefit.obj
  [ 18%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/lsh.obj
  [ 18%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/matchcontours.obj
  [ 18%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/moments.obj
  [ 18%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/morph.obj
  [ 19%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/precomp.obj
  [ 19%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/pyramids.obj
  [ 19%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/pyrsegmentation.obj
  [ 19%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/rotcalipers.obj
  [ 19%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/samplers.obj
  [ 19%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/segmentation.obj
  [ 20%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/shapedescr.obj
  [ 20%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/smooth.obj
  [ 20%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/spilltree.obj
  [ 20%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/subdivision2d.obj
  [ 20%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/sumpixels.obj
  [ 21%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/tables.obj
  [ 21%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/templmatch.obj
  [ 21%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/thresh.obj
  [ 21%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/undistort.obj
  [ 21%] Building CXX object modules/imgproc/CMakeFiles/opencv_imgproc.dir/src/utils.obj
  mingw32-make[2]: *** No rule to make target `lib/opencv_core231.lib', needed by `bin/opencv_imgproc231.dll'.  Stop.
  mingw32-make[1]: *** [modules/imgproc/CMakeFiles/opencv_imgproc.dir/all] Error 2
  mingw32-make: *** [all] Error 2
  
  C:\OpenCV-2.3.1\opencv\cmake-release&gt;
  </code></pre>
  
  <p>Same problem occured during installation 2.4.3 and also 2.4.2. (crash during linking  opencv_imgproc)</p>
  
  <p>I don't know what I am doing wrong. It seems that I am not including some libraries.</p>
  
  <p>Thank you for any advice</p>