I have compiled the gnu standard library and installed it in $GLIBC_INST
.
Now, I try to compile a very simple programm (using only one #include : #include <stdio.h>
):
gcc --nostdinc -I$GLIBC_INST/include foo.c
The compilation (preprocessor?) tells me, that it doesn't find stddef.h
.
And indeed, there is none in $GLIBC_INST/include
(nor is there one in /usr/include
). However, I found a stddef.h
in /usr/lib/gcc/x86_64-unknown-linux-gnu/5.3.0/include
.
Why is that file not under /usr/include
? I thought it belonged to the standard c library and should be installed in $GLIBC_INST/include
.
How can I compile my foo.c
with the newly installed standard library when it doesn't seem to come with a stddef.h
?
Edit: Clarification
I feel that the title of this question is not optimal. As has been pointed out by some answers, there is not a requirement for stddef.h
to be in /usr/include
(or $GLIBC_INST/include
, for that matter). I do understand that.
But I am wondering how I can proceed when I want to use $GLIBC_INST
. It seems obvious to me (although I might be wrong here) that I need to invoke gcc with --nostdinc
in order to not use the system installed header files.
This entails that I use -I$GLIB_INST/include
. This is clear to me.
Yet, what remains unclear to me is: when I also add -I/usr/lib/gcc/x86..../include
, how can I be sure that I do have in fact the newest header files for the freshly compiled glibc?