avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] Including Header Files


From: eric
Subject: Re: [avr-gcc-list] Including Header Files
Date: Mon, 9 Jun 2003 13:35:41 GMT

> Hello,
> 
> I am new to AVR's and the GCC compiler and am hoping 
someone can help me out
> with the following problem.  I am using avr-gcc 3.3 from 
the AVR Freaks
> website.  What I am confused about is how "make" knows 
that header files
> (such as io.h) are (the directory they reside in is not 
used by the
> makefile).  In the same vein, I am at a loss as to how I 
can in include a
> *.h file that is located in a different directory than 
the default header
> files (i.e. io.h).  How do I tell the compiler where it 
should look for
> header files?
> 


make doesn't know where the header files are at. However, 
GCC (avr-gcc) does. GCC knows where to look in certain 
system directories for standard header files. For something 
like io.h, you would include it with:
#include <avr/io.h>
The avr directory is a subdirectory off of one of the 
standard directories GCC looks in for header files. (You 
don't need to use -I in this case).

You can also read the WinAVR README file, under Layout, for 
some clues as to where some of these files resides.

If you have some 3rd party libraries and you would like to 
include their headers, then you would use the GCC -I switch 
to specify the directory for GCC to look in for those 
header files. See the GCC user manual for more information 
about the -I switch.

Eric




reply via email to

[Prev in Thread] Current Thread [Next in Thread]