I have asked a similar question on How to link and use OpenCV headers?, but no luck so far. So I decided to ask a new, more specific question.
Can someone tell me wh
See http://docs.opencv.org/doc/tutorials/introduction/windows_visual_studio_Opencv/windows_visual_studio_Opencv.html#windows-visual-studio-how-to
Add these to your stdafx.h
#include <opencv2/core/core.hpp> // cv::Mat etc, always need this
#include <opencv2/imgproc/imgproc.hpp> // all the image processing functions
#include <opencv2/highgui/highgui.hpp> // Display and file I/O
Assuming you have set OPENCV_DIR to the place you put opencv eg. OPENCV_DIR=c:\opencv2.4\opencv
Then set the VC++ directories in project settings to
Include add $(OPENCV_DIR)\include
and to Library add $(OPENCV_DIR)\lib
Then in the "linker Input" add opencv_core240.lib (opencv_core240D.lib for debug) opencv_imgproc240.lib and opencv_highgui240.lib etc
The folder structure of OpenCV has changed in 2.4, therefore you should use other folder than mentioned in the tutorial:
OPENCV_DIR
to the build-directory (e.g. C:\opencv\build
), NOT the platform-specific dir.%OPENCV_DIR%\x86\vc10\bin
)...$(OPENCV_DIR)\x86\vc10\lib
)