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

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

Re: [avr-gcc-list] very simple program


From: David Kelly
Subject: Re: [avr-gcc-list] very simple program
Date: Sun, 2 Oct 2005 08:50:12 -0500


On Oct 2, 2005, at 7:21 AM, Timothy Smith wrote:

i'm learning the in's and out's of microcontroller programming, but i've run into a really fundamental problem. i get the following error when i attempt to use _BV to shift a shit and set port b pin 0 to output

4: undefined reference to `__stack'

and here is my code

#include <avr/io.h>

int
main(void){
     while (1) {
       DDRB = _BV(PB0);
   };
}

Yeah, well what else are you doing? What CPU? How are you specifying the CPU to the compiler? Who is complaining about __stack? My guess is that its the linker not the compiler and it has something to do with your CPU selection or failure to specify to both compiler and linker.

Also use of _BV(PB0) is discouraged as its nothing more than (1<<PB0) and for most the shift is actually easier to read and understand.

--
David Kelly N4HHE, address@hidden
========================================================================
Whom computers would destroy, they must first drive mad.





reply via email to

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