

First of all, try no to use Windows.
1. Make sure you got the following installed
- C:\OpenCV2.1
- C:\MinGW
- C:\msys
2. Right click on your project and click in Properties and complete the following:
Build » C++ Compiler » Include Directories » C:/OpenCV2.1/include/opencv

» Linker
» Additional Library Directories » C:/OpenCV2.1/lib
» Libraries » cv210.dll, cvaux210.dll,
cxcore210.dll, highgui210.dll

3. Build your project.
Executable (*.exe) file will be generated and located in your project directory on the following path: dist/Debug/MinGW-Windows/
Use this simple code to test your recently set environment:
#include "highgui.h"
int main(int argc, char** argv){
IplImage* img = cvLoadImage(argv[1]);
cvNamedWindow("ImgViewer", CV_WINDOW_AUTOSIZE);
cvShowImage("ImgViewer", img);
cvWaitKey(0);
cvReleaseImage(&img);
cvDestroyWindow("ImgViewer");
}




dic 05, 2010 @ 08:18:34
THANK YOU SIR! very helpful.
clarification:
» Libraries » cv210.dll, cvaux210.dll,
cxcore210.dll, highgui210.dll
select the “Add Library” option, and navigate to OpenCV2.1/bin folder they are in there
abr 09, 2011 @ 09:46:29
very nice
helped me a lot
one problem though
i’m working with version 2.2 now
and some of the dll are not availible anymore
witch should i include?
availible:
msvcp100.dll
msvcr100.dll
opencv_calib3d220.dll
opencv_contrib220.dll
opencv_core220.dll
opencv_features2d220.dll
opencv_ffmpeg220.dll
opencv_flann220.dll
opencv_gpu220.dll
opencv_highgui220.dll
opencv_imgproc220.dll
opencv_legacy220.dll
opencv_ml220.dll
opencv_objdetect220.dll
opencv_ts220.dll
opencv_video220.dll