2.3. Search Path
2.3 Search Path
GCC looks in several different places for headers. On a normal Unix system, if you do not instruct it otherwise, it will look for headers requested with #include <
file>
in:
/usr/local/include libdir/gcc/target/version/include /usr/target/include /usr/include
For C++ programs, it will also look in libdir/../include/c++/version, first. In the above, target is the canonical name of the system GCC was configured to compile code for; often but not always the same as the canonical name of the system it runs on. version is the version of GCC in use.
You can add to this list with the -Idir command-line option. All the directories named by -I
are searched,