Cannot open include file config.h

SSEMember picture SSEMember · Jul 10, 2012 · Viewed 16.8k times · Source

One of the header files uses

#include <config.h>

but I keep getting the error

Fatal error C1083: Cannot open include file: 'config.h': No such file or directory

and I don't know why. config.h is in the headers folder in the project and when I right-click on it, I can actually open the file too, but I still get this error when building the project.

Answer

Luchian Grigore picture Luchian Grigore · Jul 10, 2012

That must mean the directory is not added to the extra include directories tab in the project properties. If the header is not in the same location as the source file, it doesn't matter if it's added to the project or not.

Go to Project properties (right click on project) -> Configuration Properties -> C/C++ -> General -> Additional include directories and add the directory where the header resides (probably something like "./headers").