Configure MinGW, Eclipse IDE for C/C++ Developers and OpenCV 2.4.10


I spent few days to find suitable tutorial with complete information, how to configure OpenCV 2.4.10 with eclipse. New versions do not give pre-compiled binaries whereas OpenCV has support for JAVA and other languages. But it was developed in C++ and there are many ready made codes available in C/C++. Basically research community is still mostly using C++. That’s the motive to configure eclipse, MinGW and OpenCV.

Finally i got a clue and compiled my own binaries. I faced lot of errors during the rest of process.

I followed the following steps to configure OpenCV 2.4.10 with my eclipse and finally it works.

What you need to download.

  1. Download OpenCV 2.4.10 from here
  2. Download eclipse for C/C++ Developer from here
  3. Download MinGW from here
  4. Download CMake tool from here. I am using windows 7 and i downloaded executable file cmake-3.1.3-win32-x86.exe.

Once download completed you can start installation process.

OpenCV 2.4.10

  1. Install MinGW and add environment variable. In my case i added following paths “E:\MinGW\bin; E:\MinGW\msys\1.0\bin;”
  2. Unzip eclipse to a specified location.
  3. Extract OpenCV 2.4.10 to a specified location. In my case it is E:/opencv. All necessary files required by CMake are available in E:/opencv/sources
  4. Install CMake and run CMake GUI
  5. Choose source folder. In my case it is E:/opencv/sources
  6. Choose destination files. in my case i created E:/opencv/MinGW/x86
  7. Press configuration button, then generate button
  8. Exit program once the generation is done and close cmake program
  9. Run command prompt and go to destination directory of recently generated libraries E:/opencv/MinGW/x86
  10. Type “mingw32-make”. You will see a progress of building binaries.
  11. Add environment variable of recent generated libraries address that is E:/opencv/MinGW/x86/bin
  12. Go to eclipse, create a C++ project using the OpenCV code.
  13. Go to Project > Properties > C/C++ Build > Settings > GCC C++ Compiler > Includes, and add the source OpenCV folder. In my case it is “E:\opencv\build\include”
  14. Go to Project > Properties > C/C++ Build > Settings > MinGW C++ Linker > Libraries, and add all libraries one by one. Name of all libraries are listed below with image taken during configuration
  15. in library search path, add the opencv bin folder. In my case it is “E:\opencv\minGW\x86\bin”
  16. The output screen shot is here

step.libopencv_calib3d2410, libopencv_contrib2410, libopencv_core2410,

libopencv_flann2410,libopencv_gpu2410, libopencv_highgui2410,

libopencv_imgproc2410, libopencv_ml2410, libopencv_legacy2410l, libopencv_nonfree2410l, libopencv_objdetect2410,

libopencv_ocl2410, libopencv_photo2410, libopencv_stitching2410, libopencv_superres2410,

libopencv_video2410, libopencv_videostab2410, opencv_ffmpeg2410, libopencv_ml2410

 

Note :

Restrat eclipse or your computer once you are done with rest of configurations.

Include Path

Include Path

Include Search Path and libraries

Include Search Path and libraries

After execution. Eclipse screen shot is taken

After execution. Eclipse screen shot is taken

No Responses