Reference from Http://stackoverflow.com/questions/13754348/opencv-on-eclipse-on-windows
Step 1. Download
1. Eclipse C + +. Select windows 32-bit or windows 64-bit
2. Minggw.
2.1 Follow "Basic Setup", select all and click Installation, apply ...
2.2 Add Bin directory to Path (MyComputer, prosperties, advanced system settings, Environment Variables-& Gt System Variables:path->edit Add the directory).
3. OpenCV for Windows 2.4.10. Extract files and add the bin directory = Path (MyComputer, prosperties, advanced system settings, ENV Ironment Variables, System Variables:path->edit Add the directory).
Step 2. Create and Configure
1. Open the Eclipse, Create a new C + + Project:file > New > C + + project ( Don ' t forget to sel ECT the MinGW toolchains)
2. Replace test code
code///////////#include "opencv2/highgui/highgui.hpp" #include <iostream>using namespace CV; Using namespace Std;int main (int argc, char** argv) { Mat im = imread (argc = = 2? Argv[1]: "Lenna.png", 1);//The Imag E in your project if (Im.empty ()) { cout << "Cannot open image!" << Endl; return-1; } Imshow ("image", IM); Waitkey (0); return 0;} code///////////
3. Now go to Properties >> C + + Build >> Settings on the Tool Setting tab:
GCC C + + Compiler >> includes and include OPENCV path! [Opencvdir\build\include]
MinGW C + + Linker >> Libraries and add the Library search path [opencvdir\build\x86\mingw\lib]
Add OpenCV to eclipse on Windows