"Undefined reference to setup/loop" error

Can somebody clearly explain me this error? What I have to do? Andurino 1.8.12 , when I sketch marlin 2.0 it goes well and I upload it to my Ender 5 pro (Sanguino, ATmega1284P), but as soon as I try to make so corrections in sketch (like add mesh leveling) it gives me:

C:\Users\Serge-SW\AppData\Local\Temp\cc0FlGJd.ltrans0.ltrans.o: In function `main':

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:43: undefined reference to `setup'

C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/main.cpp:46: undefined reference to `loop'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Sanguino.

Split from an old thread

The error message says it all

You don’t have a setup() or loop() function in your program

Anatomy of an Arduino sketch.