- Download the OpenCV 2.1.0 Windows installer from SourceForge - "OpenCV-2.1.0-win32-vs2008.exe".
- Install it to a folder, say "C:\Program Files\OpenCV\OpenCV210\". This article will refer to this path as $openCVDir
- During installation check the option to add it to your Current User PATH
Configure Visual Studio:
- Open VC++ Directories configuration: Tools > Options > Projects and Solutions > VC++ Directories
- Choose "Show directories for: Include files" then Add "$openCVDir\include\opencv"
- Choose "Show directories for: Library files" then Add "$openCVDir\lib" (*.lib and *.dll files)
- Choose "Show directories for: Source files"
Configure your Project:
After you've created a project you'll need to add the OpenCV dependencies.
Open Project Properties: Project > %projectName% Properties...
Open Linker Input properties: Configuration Properties > Linker > Input
Open the "..." window to edit "Additional Dependencies" and on each line put:
And any other lib file necessary for your project
Your project should now build. If you get any errors try restarting Visual Studio and then doing a clean Rebuild.