undefined reference to 'WiFiUDP::beginPacket' error

i make this code to use wifi udp in esp8266. but multiple library error occured. how can i fix or use udp??

using this library
https://github.com/esp8266/Arduino/blob/master/libraries/ESP8266WiFi/src/WiFiUdp.h

c:/users/parktong/appdata/local/arduino15/packages/esp8266/tools/xtensa-lx106-elf-gcc/2.5.0-4-b40a506/bin/../lib/gcc/xtensa-lx106-elf/4.8.2/../../../../xtensa-lx106-elf/bin/ld.exe: libraries\ESP8266WiFi\ESP8266WiFi.a(WiFiUdp.cpp.o):(.rodata._ZTV7WiFiUDP[vtable for WiFiUDP]+0x40): undefined reference to `WiFiUDP::beginPacket(char const*, unsigned short)'

collect2.exe: error: ld returned 1 exit status

"SPI.h"를 위한 복수개의 라이브러리가 발견되었습니다
 사용됨: C:\Users\parktong\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\SPI
"ESP8266WiFi.h"를 위한 복수개의 라이브러리가 발견되었습니다
 사용됨: C:\Users\parktong\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.6.3\libraries\ESP8266WiFi
"MFRC522.h"를 위한 복수개의 라이브러리가 발견되었습니다
 사용됨: C:\Program
exit status 1
보드 Generic ESP8266 Module 컴파일 에러.
//this doesn't work
#ifndef RST_PIN
#define RST_PIN   9
#define SS_PIN    10
#define transmit_en_pin 4
#endif

#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include <MFRC522.h>
#include <SPI.h>

MFRC522 mfrc(SS_PIN, RST_PIN);
WiFiUDP udp;

byte drone[6][4];
char wifi_list_of_dron[6][50] = {};  //텔로 wifi 이름 추가
char main_wifi[] = ""; //중앙 통신용 wifi 이름 추가
int connected_drons = 0;
unsigned int com_port = 9000;

void connect_wifi(char ssid[])
{
  WiFi.begin(ssid);

  Serial.print("Connecting");
  while (WiFi.status() != WL_CONNECTED)
  {
    delay(250);
    Serial.print(".");
  }
  Serial.println();

  Serial.print("Connected, IP address: ");
  Serial.println(WiFi.localIP());
}

void Send(char ssid[], char message[])
{
  connect_wifi(ssid);

  /*
  udp.begin((uint16_t)com_port);
  IPAddress ip = WiFi.localIP();
  udp.beginPacket(ip, (uint16_t)com_port);
  udp.write(message);

  udp.endPacket();
  */
  WiFi.disconnect();
  delay(100);
}

void setup()
{
  Serial.begin(115200);
  delay(250);

  SPI.begin();
  mfrc.PCD_Init();

  int retries = 0;
  while ((WiFi.status() != WL_CONNECTED) && (retries < 10)) {
    retries++;
    delay(500);
    Serial.print(".");
  }
  if (WiFi.status() == WL_CONNECTED) {
    Serial.println(F("WiFi connected"));
  }
}




void loop()
{
 if (connected_drons < 6)
  {
    //read the rfid tag
    if ( !mfrc.PICC_IsNewCardPresent() || !mfrc.PICC_ReadCardSerial() )
    {
      delay(500);
      return;
    }
    Serial.print("\n");
    Serial.print("Card UID:");
    for (int i = 0; i < 4; i++)
    {
      Serial.print(mfrc.uid.uidByte[i], HEX);
      drone[connected_drons][i] = (mfrc.uid.uidByte[i]);
      Serial.print(" ");
    }
    Serial.print("\n");
    Serial.print("drone ");
    Serial.print(connected_drons + 1);
    Serial.print(" :");

    for (byte k = 0; k < 4; k++)
    {
      Serial.print(drone[connected_drons][k], HEX);
      Serial.println(" ");
    }

    connected_drons++;
  }



  else
  {
    //main code

  }
  delay(100);
}
//this works
#ifndef RST_PIN
#define RST_PIN   9
#define SS_PIN    10
#define transmit_en_pin 4
#endif

#include <ESP8266WiFi.h>
#include <WiFiUdp.h>
#include <MFRC522.h>
#include <SPI.h>

MFRC522 mfrc(SS_PIN, RST_PIN);
//WiFiUDP udp;

byte drone[6][4];
char wifi_list_of_dron[6][50] = {};  //텔로 wifi 이름 추가
char main_wifi[] = ""; //중앙 통신용 wifi 이름 추가
int connected_drons = 0;
unsigned int com_port = 9000;

void connect_wifi(char ssid[])
{
  WiFi.begin(ssid);

  Serial.print("Connecting");
  while (WiFi.status() != WL_CONNECTED)
  {
    delay(250);
    Serial.print(".");
  }
  Serial.println();

  Serial.print("Connected, IP address: ");
  Serial.println(WiFi.localIP());
}

void Send(char ssid[], char message[])
{
  connect_wifi(ssid);

  udp.begin((uint16_t)com_port);
  IPAddress ip = WiFi.localIP();
  udp.beginPacket(ip, (uint16_t)com_port);
  udp.write(message);

  udp.endPacket();
  WiFi.disconnect();
  delay(100);
}

void setup()
{
  Serial.begin(115200);
  delay(250);

  SPI.begin();
  mfrc.PCD_Init();

  int retries = 0;
  while ((WiFi.status() != WL_CONNECTED) && (retries < 10)) {
    retries++;
    delay(500);
    Serial.print(".");
  }
  if (WiFi.status() == WL_CONNECTED) {
    Serial.println(F("WiFi connected"));
  }
}




void loop()
{
 if (connected_drons < 6)
  {
    //read the rfid tag
    if ( !mfrc.PICC_IsNewCardPresent() || !mfrc.PICC_ReadCardSerial() )
    {
      delay(500);
      return;
    }
    Serial.print("\n");
    Serial.print("Card UID:");
    for (int i = 0; i < 4; i++)
    {
      Serial.print(mfrc.uid.uidByte[i], HEX);
      drone[connected_drons][i] = (mfrc.uid.uidByte[i]);
      Serial.print(" ");
    }
    Serial.print("\n");
    Serial.print("drone ");
    Serial.print(connected_drons + 1);
    Serial.print(" :");

    for (byte k = 0; k < 4; k++)
    {
      Serial.print(drone[connected_drons][k], HEX);
      Serial.println(" ");
    }

    connected_drons++;
  }



  else
  {
    //main code

  }
  delay(100);
}

It would be a good idea, to give the difference of the both code variants. Nobody may find it by himself.