[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] Building code
From: |
Senthil Kumar Selvaraj |
Subject: |
Re: [avr-gcc-list] Building code |
Date: |
Thu, 9 Oct 2014 09:48:07 +0530 |
User-agent: |
Mutt/1.5.23 (2014-03-12) |
On Thu, Oct 09, 2014 at 12:54:48AM +0200, Andreas Höschler wrote:
> Hi all,
>
> I have just got my avr tool chain running on Solaris, established
> communication of avrdude with the USB programmer and am now trying to
> recompile my first program (one that I wrote years ago on another machine).
>
> It goes like so:
>
> main.c
> ======
> #define F_CPU 16000000UL /* 16 MHz CPU clock */
> #include "Global.h"
> #include <util/delay.h>
> #include <avr/io.h>
> #include <avr/interrupt.h>
> #include <inttypes.h>
> #include <Serial.h>
> #include <AnalogDigital.h>
> #include <Timer.h>
> #define OUTPUTPORT PORTB
> #define OUTPUTPIN PD5
>
> static volatile uint16_t startA;
> ...
>
> Makefile
> ==========
> # AVR-GCC Makefile
> PROJECT=toggle_led
> SOURCES=main.c Serial.c Timer.c AnalogDigital.c
> HEADERS=Serial.h
> CC=avr-gcc
> OBJCOPY=avr-objcopy
> MMCU=atmega8
>
> CFLAGS=-mmcu=$(MMCU) -Wall -O2
>
> $(PROJECT).hex: $(PROJECT).out
> $(OBJCOPY) -j .text -O ihex $(PROJECT).out $(PROJECT).hex
>
> $(PROJECT).out: $(SOURCES)
> $(CC) $(CFLAGS) -I./ -o $(PROJECT).out $(SOURCES)
>
> program: $(PROJECT).hex
> avrdude -p atmega8 -c avrispmkII -P usb -e -U flash:w:$(PROJECT).hex
> clean:
> rm -f $(PROJECT).out
> rm -f $(PROJECT).hex
>
>
> When I try to make this I get
>
> -bash-3.2# make
> avr-gcc -mmcu=atmega8 -Wall -O2 -I./ -o toggle_led.out main.c Serial.c
> Timer.c AnalogDigital.c
> main.c:3:24: error: util/delay.h: No such file or directory
> main.c:4:20: error: avr/io.h: No such file or directory
> main.c:5:27: error: avr/interrupt.h: No such file or directory
> main.c:6:22: error: inttypes.h: No such file or directory
> In file included from main.c:7:
> ./Serial.h:3: error: expected ')' before 'baud'
> ./Serial.h:4: error: expected ')' before 'data'
>
The compiler is not able to find header files supplied by avr-libc. Did
you build both of them with the same install prefix? Can you paste the
output of running avr-gcc with -v?
Regards
Senthil
- [avr-gcc-list] Building code, Andreas Höschler, 2014/10/08
- Re: [avr-gcc-list] Building code,
Senthil Kumar Selvaraj <=
- Re: [avr-gcc-list] Building code, Andreas Höschler, 2014/10/09
- Re: [avr-gcc-list] Building code, Senthil Kumar Selvaraj, 2014/10/09
- Re: [avr-gcc-list] Building code, Andreas Höschler, 2014/10/09
- [avr-gcc-list] Converting string to uint32_t, Andreas Höschler, 2014/10/13
- Re: [avr-gcc-list] Converting string to uint32_t, Georg-Johann Lay, 2014/10/14
- Re: [avr-gcc-list] Converting string to uint32_t, Wim Lewis, 2014/10/14
- Re: [avr-gcc-list] Converting string to uint32_t, Andreas Höschler, 2014/10/14