home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.questions:14650 comp.lang.c:18296
- Path: sparky!uunet!munnari.oz.au!metro!socs.uts.edu.au!kralizec.zeta.org.au!kralizec.zeta.org.au!not-for-mail
- From: craig@kralizec.zeta.org.au (Craig Dewick)
- Newsgroups: comp.unix.questions,comp.lang.c
- Subject: Re: #include "from/somewhere/else"
- Date: 13 Dec 1992 12:01:38 +1100
- Organization: Kralizec Dialup Unix Sydney: +61-2-837-1183 V.42bis
- Lines: 34
- Message-ID: <1ge21iINNge4@kralizec.zeta.org.au>
- References: <aet.724150848@munagin>
-
- aet@mullian.ee.mu.OZ.AU (bert thompson) writes:
-
- >does anyone know how to redefine the default directory from
- >which C takes its #include "files"?
-
- >e.g.
-
- >#include "file.h"
-
- >might include a file from $HOME/my_includes rather than from
- >the usual /usr/include.
-
- This may not be exactly what you're after, but most c compiler front
- ends support an option to specify additional directories to search for
- header files. On my system, there a '-I' option, which is used to do
- this. For example, if I type:
-
- cc test.c -I/extra_headers
-
- the compiler will look in /usr/include AND in /extra_headers to find
- any include files. Of course, if you specify
-
- #include <fred/include.h>
-
- in the source file, it will look for directories called /usr/include/fred
- AND /extra_headers/fred.
-
- As far as modifying it on a system-wide basis, I don't really know. I
- suspect that there is some system-specific header file that contains all
- such definitions.
- --
- Craig Dewick | - Railway Preservation Industries -
- Send email to: | Supporting the Preservation
- craig@kralizec.zeta.org.au | of Australia's Railway Heritage
-