PDA

Archiv verlassen und diese Seite im Standarddesign anzeigen : undefined reference to `main' ?



robots4-ever
13.04.2013, 20:46
Hallo ich habe folgendes Problem, ich habe grade auf die schnelle eine Code geschrieben um Servos anzusteuern.

//#include <LiquidCrystal.h>#include <Servo.h>


//
Servo alphaOne;
Servo alphaTwo;
//Servo alphaThree;
//
Servo betaOne;
Servo betaTwo;
//Servo betaThree;
//
Servo gammaOne;
Servo gammaTwo;
//Servo gammaThree;
//
Servo deltaOne;
Servo deltaTwo;
//Servo deltaThree;
//
//#define IRS 1 //AbstandSensor AnalogerPortPin
//
//LiquidCrystal lcd(0,1,2,3,4,5,6);
//
void setup() {
//
alphaOne.attach(13);
alphaTwo.attach(12);
//alphaThree.attach(11);
//
betaOne.attach(10);
betaTwo.attach(9);
//betaThree.attach(8);
//
gammaOne.attach(7);
gammaTwo.attach(6);
//gammaThree.attach(5);
//
deltaOne.attach(4);
deltaTwo.attach(3);
//deltaThree.attach(2);
//

}




void loop() {
alphaOne.write(90);
alphaTwo.write(90);
//alphaThree.attach(4);
//
betaOne.write(90);
betaTwo.write(90);
//betaThree.attach(7);
//
gammaOne.write(90);
gammaTwo.write(90);
//gammaThree.attach(10);
//
deltaOne.write(90);
deltaTwo.write(90);
//deltaThree.attach(13);
//
//

//
}


und als Fehlermeldung bekommen ich nun

c:/users/tom/desktop/arduino-1.0.1/hardware/tools/avr/bin/../lib/gcc/avr/4.3.2/../../../../avr/lib/avr51/crtm1280.o:(.init9+0x0): undefined reference to `main'

ich weis aber nicht wo mein Fehler ist.

Könnt ihr mir helfen?

021aet04
13.04.2013, 21:33
Wo ist das Hauptprogramm (main)? Hast du dir schon C Programme angeschaut?

MfG Hannes

robots4-ever
13.04.2013, 22:07
Das ist das Hauptprogramm das Main heißt.

robots4-ever
14.04.2013, 05:55
geht jetzt wieder. Ich habe das Programm jetzt einfach um benannt .

021aet04
15.04.2013, 10:02
Das ist ein falscher Aufbau eines C Programmes. Es soll nicht die Datei "main" heißen sondern im Programm soll es ein main geben.
http://www.cpp-tutor.de/cpp/le01/main.html dieses Tutorial ist zwar für C++, der Aufbau ist aber gleich.

MfG Hannes