[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-gcc-list] problems using time.h on freebsd 4.10
From: |
Timothy Smith |
Subject: |
[avr-gcc-list] problems using time.h on freebsd 4.10 |
Date: |
Thu, 01 Sep 2005 17:17:27 +1000 |
User-agent: |
Mozilla Thunderbird 1.0.6 (X11/20050721) |
my code example
#include <inttypes.h>
#include <avr/io.h>
#include <time.h>
int main(void)
{
DDRA = (1 << 1);
time_t blink = time(NULL)+2;
while (1) {
while (blink < time(NULL)) {
PORTA = 1;
};
blink = time(NULL)+2;
while (blink < time(NULL)) {
PORTA = 0;
};
blink = time(NULL)+2;
};
}
# avr-gcc -I/usr/include -g -Os -mmcu=atmega32 led.c
/var/tmp//ccJbKrxY.o(.text+0x16): In function `main':
/home/timothy/AVR/led.c:11: undefined reference to `time'
/var/tmp//ccJbKrxY.o(.text+0x2c):/home/timothy/AVR/led.c:13: undefined
reference to `time'
/var/tmp//ccJbKrxY.o(.text+0x4c):/home/timothy/AVR/led.c:15: undefined
reference to `time'
/var/tmp//ccJbKrxY.o(.text+0x62):/home/timothy/AVR/led.c:17: undefined
reference to `time'
if i don't use the -I flag i get
avr-gcc -g -Os -mmcu=atmega32 led.c
led.c:3:18: time.h: No such file or directory
led.c: In function `main':
led.c:8: error: `time_t' undeclared (first use in this function)
led.c:8: error: (Each undeclared identifier is reported only once
led.c:8: error: for each function it appears in.)
led.c:8: error: parse error before "blink"
led.c:10: error: `blink' undeclared (first use in this function)
led.c:10: error: `NULL' undeclared (first use in this function)
however...
ls -l /usr/include/time.h
-r--r--r-- 1 root wheel 5366 May 26 2004 /usr/include/time.h
so time.h is clearly there.
so. obviously there is something funky about time.h and avr-gcc under
fbsd 4.10. where are my details
# avr-gcc -v
Reading specs from /usr/local/lib/gcc/avr/3.4.4/specs
Configured with: ./configure --target=avr --disable-nls
--prefix=/usr/local i386-portbld-freebsd4.10
Thread model: single
gcc version 3.4.4
- [avr-gcc-list] problems using time.h on freebsd 4.10,
Timothy Smith <=