Do quotes in library include path in C++ mean base directory of the project?
Do quotes in library include path in C++ mea开发者_运维技巧n base directory?
#include "header.h"
I would think it would be in the project folder, but I am wrong.
#include <foo.h>
means that it will look for the file anywhere in the include path.
#include "foo.h"
means to look relative to the directory of the file that the #include
statement is written in, and fallback on the include path if it cannot be found locally.
That will only look in the directory of the file. ie if you had the following setup:
folder: src
contents: header.c
folder: src/include
contents: header.h
If you had the line above in header.c, the preprocessor would not find the header.h file.
精彩评论