[Top][All Lists]

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

Re: [avr-gcc-list] link problems

From: Joerg Wunsch
Subject: Re: [avr-gcc-list] link problems
Date: Tue, 8 Mar 2005 20:59:58 +0100 (MET)

"address@hidden" <address@hidden> wrote:

> I also noticed another weird thing (weird to me) regarding the
> function cli() - which seems to be defined in interrupt.h If I only
> include avr/io.h the code compiles (!!) but I get link errors.  If I
> also include avr/interrupt.h the code compiles and link fine.

cli() is not a true function but a macro defined in <avr/interrupt.h>.
So if you miss to include the header file, the compiler takes it as an
undefined reference to a function named cli() which the linker then
cannot find.  If you include the header file, the preprocessor expands
the macro (to some inline assembler code, actually).

cheers, J"org               .-.-.   --... ...--   -.. .  DL8DTL

http://www.sax.de/~joerg/                        NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)

reply via email to

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