- Download OpenCV: http://opencv.org/
- Run/extract the downloaded file. (Can be C:\)
- Create a new C++ Win32 Console Application in visual studio.
- Set the project as Debug or Release mode.
- Set your platform as x86 or x64 (Configuration Manager).
- Configure project properties: (The following steps will depend on the selection of build mode, platform, vs version and opencv version.
- Configuration Properties -> VC++ Directories:
- Include Directories: add the directory to include files - OpenCVDir\build\include
- Library Directories: add the directory to library files - OpenCVDir\build\(PLATFORM, e.g. x64)\(VISUAL STUDIO VERSION, e.g. vc12)\lib
- Linker -> General: Use Library Dependency Inputs = Yes
- Linker -> Input -> Additional Dependencies: add lib files. Format: NAME+VERSION+(d).lib, d means debug mode. Release mode should use those without d.
- Write code and run. Here's an example:
- OpenCV Version
- VC Version: VC7(2003), VC8(2005), VC9(2008), VC10(2010), VC11(2012), VC12(2013)
- Mode: Debug/Release
- Platform: x86/x64