Forum: Compiler & IDEs Hilfe, Fehler beim Compilieren


von Joline (Gast)


Angehängte Dateien:

Lesenswert?

Hi,

beim Versuch, die Datei im Anhang zu übersetzen, erhalte ich folgende
Compilermeldungen:

===================================================================
set -e; avr-gcc -MM -mmcu=at90s2313 -I. -g -O0 -funsigned-char
-funsigned-bitfields -fpack-struct -fshort-enums -Wall
-Wstrict-prototypes -Wa,-adhlns=clock.lst  -std=gnu99 clock.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > clock.d; \
[ -s clock.d ] || rm -f clock.d

-------- begin --------
avr-gcc (GCC) 3.3.1
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.


Compiling: clock.c
avr-gcc -c -mmcu=at90s2313 -I. -g -O0 -funsigned-char
-funsigned-bitfields -fpack-struct -fshort-enums -Wall
-Wstrict-prototypes -Wa,-adhlns=clock.lst  -std=gnu99 clock.c -o
clock.o
clock.c:10:26: avr/inttypes.h: No such file or directory
clock.c:13:24: avr/macros.h: No such file or directory
clock.c:28: warning: ignoring #pragma interrupt_handler
Crossing_interrupt
clock.c:29: warning: ignoring #pragma interrupt_handler IR_interrupt
clock.c:30: warning: ignoring #pragma interrupt_handler
Degre_interrupt
clock.c:31: warning: ignoring #pragma interrupt_handler
Ticker_interrupt
clock.c:93: warning: function declaration isn't a prototype
clock.c:93: warning: return type of `main' is not `int'
clock.c: In function `main':
clock.c:119: warning: implicit declaration of function `SEI'
make: *** [clock.o] Error 1

===================================================================

Was will mir der Compiler damit sagen? Was passt ihm  nicht?


Danke Joline

von ich (Gast)


Lesenswert?

Das: "No such file or directory" will er damit sagen.

Er findet die Dateien nicht.

von Joline (Gast)


Lesenswert?

Danke. Lesen müßte man können...

von Joline (Gast)


Lesenswert?

Jetzt, nachdem der Compiler alle Dateien findet, bekomme ich folgende
Meldung:

error: invalid lvalue in assignment

Als Fehlerzeile u.a. wird angezeigt:

PORTD = 0x0d;

Aber wenn ich mir andere Beispiele so anschaue, sieht das da auch nicht
anders aus.  :o(

von Joline (Gast)


Lesenswert?

Also jetzt läuft der Compiler durch. Freu!
Ich habe statt io2313.h die io.h genommen. Wurde auch vom Compiler
empfohlen.
Aber jetzt will der Linker noch nicht:

-------------------------------------------------
Linking: clock.elf
avr-gcc -mmcu=at90s2313 -I. -g -O0 -funsigned-char -funsigned-bitfields
-fpack-struct -fshort-enums -Wall -Wstrict-prototypes
-Wa,-adhlns=clock.o  -std=gnu99 clock.o   --output clock.elf
-Wl,-Map=clock.map,--cref -lm
clock.o(.text+0x54): In function `main':
C:\WinAVR\examples\clock/clock.c:117: undefined reference to `SEI'
make: *** [clock.elf] Error 1
-------------------------------------------------

Er meint, 'SEI' sei nicht referenziert (Hat er sicher auch Recht.).
Ich habe 'interrupt.h' eingebunden. Damit sollte es doch gehen, oder?

von Joline (Gast)


Lesenswert?

Ich habs gefunden: Natürlich muss es 'sei' statt 'SEI' heissen.

Sorry für meine blöden Fragen.

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.