Cannot open include file config.h

17,566

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

Share:
17,566
SSEMember
Author by

SSEMember

I'm a Software Engineering college student at Rochester Institute of Technology.

Updated on June 15, 2022

Comments

  • SSEMember
    SSEMember almost 2 years

    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.