Error compiling for board Arduino/Genuino Mega or Mega 2560.

Why do I get this compiling error message?

"Arduino: 1.8.0 (Windows 10), Board: "Arduino/Genuino Mega or Mega 2560, ATmega2560 (Mega 2560)"

C:\Users\User\AppData\Local\Temp\cc7PVnRP.ltrans0.ltrans.o: In function `main':

C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.18\cores\arduino/main.cpp:43: undefined reference to `setup'

C:\Users\User\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.18\cores\arduino/main.cpp:46: undefined reference to `loop'

collect2.exe: error: ld returned 1 exit status

exit status 1
Error compiling for board Arduino/Genuino Mega or Mega 2560.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

Because the code you didn't post doesn't have a setup function or a loop function.