This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: warnings when compiling


>>>>> "Bui" == Bui Ngoc Huy Binh <Binh.Bui@sophia.inria.fr> writes:

    Bui> Hi, I use gcc release 3.2 to compile my programe. That's ok
    Bui> but I got the warnings as:

    Bui> cc1: warning: changing search order for system directory
    Bui> "/usr/local/include" cc1: warning: as it has already been
    Bui> specified as a non-system directory ignoring duplicate
    Bui> directory "/usr/local/include" cc1: warning: changing search
    Bui> order for system directory "/usr/include" cc1: warning: as it
    Bui> has already been specified as a non-system directory

    Bui> I don't understand and i don't know how to fix them ? Can you
    Bui> help me ?

I suppose you installed gcc in /usr/local. GCC then regards
/usr/local/include as a system include directory which implicitly is
searched for header files after any other non-system include
directories. 

If you specify -I/usr/local/include (what you don't need to) GCC
denotes this directory now as a non-system directory and thus changes
the search order for header files which it was just kind enough
informing you about.

Just don't specify /usr/local/include as non-system include directory
if it already is a system directory.

>From 'man cpp':

-I directory 
    Add the directory directory to the end of the list of directories
    to be searched for header files.  This can be used to override a
    system header file, substituting your own version, since these
    directories are searched before the system header file
    directories.  If you use more than one `-I' option, the
    directories are scanned in left-to-right order; the standard
    system directories come after.

-- 
Claudio Bley                                 ASCII ribbon campaign (")
Debian GNU/Linux advocate                     - against HTML email  X 
http://www.cs.uni-magdeburg.de/~bley/                     & vCards / \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]