문제

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.

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top