home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / question / 14650 < prev    next >
Encoding:
Internet Message Format  |  1992-12-13  |  1.6 KB

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