Thank you for your reply.
I tried what you said, but now i get a different message:
avrdude: stk500_getsync(): not in sync: resp=0x00
The ArduinoISP example that I should upload is compatible with the arduino mega 2560.
It has the following text in it:
// This sketch turns the Arduino into a AVRISP
// using the following arduino pins:
//
// pin name: not-mega: mega(1280 and 2560)
// slave reset: 10: 53
// MOSI: 11: 51
// MISO: 12: 50
// SCK: 13: 52
And I've double checked the wiring, but still don't know what the problem might be.