Visual Studio 2012: 'opencv2/opencv.hpp' : No such file or directory (C1083)

build, c++, opencv, visual-studio-2012

Solution

Open Configuration Properties > C/C+ + > General , and edit the field Additional Include Directories to add these 3 paths (for the headers): C:\OpenCV2.3\build\include\opencv C:\OpenCV2.3\build\include \opencv2 C:\OpenCV2.3\build\include

Problem

This question was asked several times, there are some answers, but this problem is more specific, the additional directories path is set correctly (files are found). Nevertheless building my project i get the following error: ``` fatal error C1083: Cannot open include file: 'opencv2/opencv.hpp': No such file or directory ``` but i can right click on the file and open it in visual studio 2012? I tried: 1) specifying the full path: WORKS! ``` #include <D:\frameworks\opencv_2_4\build\include\opencv2\opencv.hpp> ``` 2) Putting the file to C:\ Doesn't Work! (add. directories added) 3) Empty project with the same include syntax. (add. directories added). WORKS! 4) I've configured a VS2010 Version of the same project with CMake, and i have there the same problems. Any hints what could be causing this error?

Original source