From the man page for cpp (the gcc preprocessor)
-I dir
Add the directory dir to the list of directories to be searched for
header files.
Directories named by -I are searched before the standard system
include directories.
It is dangerous to specify a standard system include directory in
an -I option. This defeats the special treatment of system headers
. It can also defeat the repairs to buggy system headers which GCC
makes when it is installed.
Plus:
Code:
#include "somefile.h"
quoted files names forces cpp to look for somefile.h using the "-I directory" specification first. Filenames in trackets "<>" are assumed to be in the standard include directory.
Code:
gcc -I. -Wall myfile.c -o myfile
will find somefile.h in your current working directory before it looks anywhere else.