first, make sure that the OPENCV environment on your computer and the environment on Visual Studio are configured, and that the test passes without problems.
second, so long as in your project in the property settings inside the configuration to include the directory is OK, the steps are as follows
1. Locate the item, right-click the property
2, click on the property will appear a project properties of the management window
It is best to configure three directories, in fact, as long as the configuration contains the directory will not be an error
the directory of executable files is: You install OpenCV directory \opencv\build\x86\vc12\bin, as for x86 and VC12 choice please Baidu view, VC12 and your version of Visual Studio, is generally visual studio2013 and above to choose this, x86 generally configure this directory is good, this and your computer system does not matter, do not be misled, at first, I also struggled for a long time
include directory: Opencv\build\include
Opencv\build\include\opencv
Opencv\build\include\opencv2
These three directories are to be configured, after the configuration is completed, click Apply and then click OK, the error disappears.