[lfs-support] Bk7.1_Ch6.17 GCC-4.6.2 search order of 'include directories'

pete Spam-Avoider x2164 at lycos.com
Sat Apr 28 17:01:37 PDT 2012


>What you have matches what I have.  We haven't looked at that particular section 
>is a while and gcc may have changed the order internally.
>Generally the order won't matter.  If you have a file do something like:
>#include <abc.h>
>It will look in the above directories in the order specified and use the first 
>one it finds.  The only problem is if there is a name conflict between header 
>files in /usr/lib/gcc/i686-pc-linux-gnu/4.6.2/include and /usr/local/include. 
>In LFS, /usr/local/include is almost always empty.
>Looking at /usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.2/include, headers like 
>stddef.h are there and you certainly would not want a file in /usr/local/include 
>overriding that.
>On an older version of gcc, /usr/local/include is first and there is no 
>include-fixed directory.
 >  -- Bruce

Thanks Bruce and Fernando for replying so quickly.

Bruce, your explanation sounds reasonable, and, if its working on your system
then I'm sure it'll work for me too.

Kind of suprised there weren't more posts about this.

Thanks again.


More information about the lfs-support mailing list