Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot open include file config.h

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.

like image 809
SSEMember Avatar asked Jul 10 '12 18:07

SSEMember


1 Answers

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").

like image 138
Luchian Grigore Avatar answered Oct 30 '22 10:10

Luchian Grigore