Sujet : Re: What are GCC's "Standard system directories" on GNU/Linux?
De : dan (at) *nospam* djph.net (Dan Purgert)
Groupes : comp.lang.cDate : 05. Feb 2025, 14:05:57
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <slrnvq6ohl.983.dan@djph.net>
References : 1
User-Agent : slrn/1.0.3 (Linux)
On 2025-02-05, Alan Mackenzie wrote:
Hello, comp.lang.c.
>
In the GCC manual, section 3.16 "Options for Directory Search" partially
describes where, how, and in what order GCC finds #include files when
compiling.
>
It's the "partially" bit which is getting on my nerves. The manual
section contains a priority list for finding #include files, but the
fifth item just vaguely states:
>
5. Standard system directories are scanned.
>
. Which directories are these? Where is this documented?
It is, as I recall, defined at compile time of gcc. You can get your
system-specific "standard system directories" by running the command:
echo | gcc -xc -E -v -
It'll print out a bunch of stuff, starting off with the compile-time
options that were used when compiling gcc itself. The bit you're
looking for being listed out under the heading:
#include <...> search starts here:
HTH
-- |_|O|_| |_|_|O| Github: https://github.com/dpurgert|O|O|O| PGP: DDAB 23FB 19FA 7D85 1CC1 E067 6D65 70E5 4CE7 2860