undefined reference to 'setup' and ... to 'loop'

Dear members,

I have a problem with programming my Arduino UNO.

If I write any code, for instance

int led = 13;

void setup()
{
  Serial.begin(9600);
  

}

void loop()
{
  pinMode(led, OUTPUT);
  
}

just to try and then upload it, following errors appear:

main.cpp.o: In function main': C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/main.cpp:11: undefined reference to setup'
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/main.cpp:14: undefined reference to `loop'

I've tried the example projects already and they work! But if I copy the example code into my test-project and then upload it, the same errors are appearing...
Please help me :wink:

Yours faithfully
Stefan

never heard of this behaviour.

throw away your test file and restart the IDE.

give it another try.

If that doesn't work, reinstall the Arduino SW. Which version are you using?

Hello robtillaart!

Thank you for your reply, I've done this already - nothing got better. =(

I'm using Arduino 1.0.5 for Windows 7.

Do you think it minds where the project is saved?
Otherwise I couldn't explain this strange error...

Is your sketch named "main" (as in main.ino)? It is an obvious name but will create problems. If so, change the name.