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

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

Re: [avr-gcc-list] how to include header file?


From: Joerg Wunsch
Subject: Re: [avr-gcc-list] how to include header file?
Date: Wed, 24 Aug 2005 10:51:38 +0200 (MET DST)

suzet war <address@hidden> wrote:

> so, the questions is, what can i do so taht WinAVR can recognize it
> and compile the code without error?

> should i put the header file of my particular hardware in the
> WinAVR/include folder?

Rather not.  Either put it into your application's directory, then
#include "filename.h" will search it directly there.  Alternatively,
put it into an arbitrary directory, and use the -I compiler switch to
tell the compiler where to look for it.  For Windows, better use
forward slashes as pathname separator in the Makefile, so say

CINCS = -Ic:/where/youve/put/it/to

rather than

CINCS = -IC:\where\youve\put\it\to

as Windows itself recognizes both as a valid pathname separator
internally, but the shell that is called by `make' (which is a Unix
shell) might cause you troubles with the backslashes.  (Optionally,
you might put a space after the -I, but historically, C compilers did
not want a space there.  GCC doesn't care.)

Hint:

#include <something.h>

is meant to be used to search for system header files, while

#include "something.h"

is intented to search for custom/application header files.  (The
difference is that the compiler will never look for a system header
file in the current directory.)

-- 
J"org Wunsch                                           Unix support engineer
address@hidden        http://www.interface-systems.de/~j/




reply via email to

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