Install OpenCV:
- 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"
Add "$openCVDir\src\cv"
Add "$openCVDir\src\cvaux"
Add "$openCVDir\src\cxcore"
Add "$openCVDir\src\highgui"
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:
"cv210.lib"
"cxcore210.lib"
"highgui210.lib"
"ml210.lib"
"opencv_ffmpeg210.lib"
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.
No comments:
Post a Comment