PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : [Gelöst] Problem beim Compilieren



Mosuro 77
09.06.2009, 17:49
Hallo.
Ich habe folgendes Problem beim Compilieren der HEX-Datei:
Das Beispielprogramm in test.c funktioniert noch einwandfrei zu compilieren.
Dann führe ich clean aus, damit die temporären Dateinen gelöscht werden.
Wenn ich jetzt aber ein neues Programm in test.c einfüge, und erfolgreich compiliere, erhalte ich die gleiche HEX-Datei wie von dem Beispielprogramm.
Wenn ich dann test.c mit dem neuen Programm speicher, und dann make ausführe, zeigt er diese Fehlermeldung an:
> "C:\ASURO_src\FirstTry\Test-all.bat"

C:\ASURO_src\FirstTry>make all
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > asuro.d; \
[ -s asuro.d ] || rm -f asuro.d
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > test.d; \
[ -s test.d ] || rm -f test.d
test.c:1:10: error: #include expects "FILENAME" or <FILENAME>
set -e; avr-gcc -MM -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c \
| sed 's,\(.*\)\.o[ :]*,\1.o \1.d : ,g' > test.d; \
[ -s test.d ] || rm -f test.d
test.c:1:10: error: #include expects "FILENAME" or <FILENAME>
-------- begin --------
avr-gcc --version
avr-gcc (WinAVR 20090306rc1) 4.3.2
Copyright (C) 2008 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.

avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=asuro.lst asuro.c -o asuro.o
In file included from asuro.h:34,
from asuro.c:29:
c:/programme/lib/gcc/../../avr/include/avr/signal.h:36:2: warning: #warning "This header file is obsolete. Use <avr/interrupt.h>."
avr-gcc -c -mmcu=atmega8 -I. -g -Os -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums -Wall -Wstrict-prototypes -Wa,-ahlms=test.lst test.c -o test.o
test.c:1:10: error: #include expects "FILENAME" or <FILENAME>
test.c: In function 'main':
test.c:4: warning: implicit declaration of function 'Init'
test.c:5: warning: implicit declaration of function 'FrontLED'
test.c:5: error: 'ON' undeclared (first use in this function)
test.c:5: error: (Each undeclared identifier is reported only once
test.c:5: error: for each function it appears in.)
test.c:6: warning: implicit declaration of function 'MotorDir'
test.c:6: error: 'FWD' undeclared (first use in this function)
test.c:9: warning: implicit declaration of function 'LineData'
test.c:12: warning: implicit declaration of function 'MotorSpeed'
make: *** [test.o] Error 1

> Process Exit Code: 2
> Time Taken: 00:01

Wisst ihr, was das Problem ist ?

Ceos
09.06.2009, 17:54
steht doch alles drin, in zeile 1:10 deiner test.c stimmt was mit deinen includes nicht, darauf folgend viele ander fehler ... hilfreich wäre es den code zu zeigen sonst muss ich die laskugel rausholen

PS: benutze die [ c o d e ][ / c o d e ] tags, das macht auch die fehlermeldung etwas übersichtlicher

Mosuro 77
10.06.2009, 14:28
Der Code ist
#include “asuro.h” // Linienverfolgung auf die einfachste Art
int main(void) {
unsigned int data[2]; //Speicher bereitstellen
Init();
FrontLED(ON); // Linienbeleuchtung einschalten
MotorDir(FWD,FWD); // Beide Motoren auf vorwärts
while(1){ // Endlosschleife, ASURO soll beliebig
// lang einer Linie nachfahren
LineData(data); // aktuelle Helligkeitswerte der
// Fototransistoren einlesen
if (data [0] > data [1] ) // links heller als rechts...
{MotorSpeed(200,150);} // ... dann links mehr Gas geben...
else
{MotorSpeed(150,200);} // ... sonst rechts mehr Gas geben!
}
return 0;
}

hai1991
10.06.2009, 15:02
hallo

ich bin mir jetzt nicht sicher ob die " immer so angezeigt werden, oder ob du die falschen verwendest


versuch doch mal die erste zeile neu ein zu geben (nicht von der Anleitung koperen, das klappt so viel ich weiß nicht)

Mosuro 77
10.06.2009, 15:13
Ey das ist ja super, jetzt klappt es!
Vielen Dank hai1991!