public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: newbie looking to add include files
@ 2003-02-04 18:19 Mark Petryk
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Petryk @ 2003-02-04 18:19 UTC (permalink / raw)
  To: gcc-help

>
>
>It's far more preferable to do "g++ -I/usr/include/myfiles" in your
>Makefile, than it is to put that kind of cruft in the GCC build itself.
>

I whole-heartedly agree, and about as quick as I asked, I realized that 
if I simply do:

#include <myfiles/myfile.h>

that I am, therefore, specifying the path as I had intended to.  Duh!  
That allows me to put my headers into their own subdirectories and then 
refer to them in a consistent manner.

But, one other question, what if you have *alot* of directories in your 
include search path, and it's something you *need* to put on the g++ 
line?  Don't they get kind of long, and therefore, sort of ugly?  In 
Borland, for instance, I think there is another place to specify 
additional search paths (globally) so that each one of your projects 
benefits from the redirection.  I would like to have my make files 
somewhat generic and not have to specify include paths in that manner, 
should they become unweildy.  Is my thinking wrong about it?



^ permalink raw reply	[flat|nested] 4+ messages in thread
[parent not found: <616BE6A276E3714788D2AC35C40CD18DA26EAD@whale.softwire.co.uk>]
* newbie looking to add include files
@ 2003-02-04 17:59 Mark Petryk
  2003-02-04 18:07 ` John Love-Jensen
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Petryk @ 2003-02-04 17:59 UTC (permalink / raw)
  To: gcc-help

I would like to add some files to the list of standard include (*.h) 
files, kind of like a library, to the standard search path of include 
files.  I see that there are many include files in /usr/include with 
many sub directories.  Copying my files into yet another sub directory 
under /usr/include did not see to make those files available to the 
compiler using:

#include <myfile.h>

I know there are command line parameters to add include paths during 
compiles (-I and the like), but how is it that the compiler knows about 
/usr/include and how does it know to search some of the sub-directories 
in that area.  Is there a configuration file somewhere that I need to 
add my additional path to so that the compiler searches in my directory 
by default?  I'd like to store my header files in a directory like: 
/usr/include/myfiles/myfile.h



^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2003-02-04 18:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-02-04 18:19 newbie looking to add include files Mark Petryk
     [not found] <616BE6A276E3714788D2AC35C40CD18DA26EAD@whale.softwire.co.uk>
2003-02-04 18:21 ` Rupert Wood
  -- strict thread matches above, loose matches on Subject: below --
2003-02-04 17:59 Mark Petryk
2003-02-04 18:07 ` John Love-Jensen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).