Official OpenCV installation manual can be found here .
Set the OPENCV_DIR environment variable according to the version of Visual Studio as:
C:\opencv\build\install\(x86 or x64)\(vc version)
C:\opencv\build\install\x86\vc11
Be sure to check the BUILD_opencv_world option.
Library paths in the OpenCV example application may vary on different system structures.
The paths can be set in the Visual Studio project settings under:
C++ -> General entry -> “Additional Include Directories”
Linker → General -> “Additional Library Directories”
Linker → Input -> “Additional Dependencies”