Mega +WiFi R3 ATmega2560+ESP8266

I have mega + wifi board of this type. Im trying to upload sketch to ESP8266 by making DIP switches 5,6,7 ON and remaining OFF.

when I try to upload the code, arduino throws this error(Capture.PNG)

Pls help me out to solve this issue. I selected generic ESP8266 board as per the instruction given in this link:

this is a compilation error, not an upload error.
you didn't install the esp8266 arduino boards package correctly. use the Boards Manager in IDE to install it