Can't upload SoftwereSerial to Arduino Zero

Hello!
I tried to upload this code to the arduino zero:

#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3); // RX, TX

void setup() {
  // Open serial communications and wait for port to open:
  Serial.begin(115200);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }


  

  // set the data rate for the SoftwareSerial port
  esp.begin(115200);
 
}

void loop() { // run over and over
  if (esp.available()) {
    Serial.write(esp.read());
  }
 
  }

And i get this error:

Arduino: 1.8.5 (Windows 7), Board: "Arduino/Genuino Zero (Programming Port)"

C:\Users\misu\Desktop\arduino-1.8.5\arduino-builder -dump-prefs -logger=machine -hardware C:\Users\misu\Desktop\arduino-1.8.5\hardware -hardware C:\Users\misu\Desktop\arduino-1.8.5\portable\packages -tools C:\Users\misu\Desktop\arduino-1.8.5\tools-builder -tools C:\Users\misu\Desktop\arduino-1.8.5\hardware\tools\avr -tools C:\Users\misu\Desktop\arduino-1.8.5\portable\packages -built-in-libraries C:\Users\misu\Desktop\arduino-1.8.5\libraries -libraries C:\Users\misu\Desktop\arduino-1.8.5\portable\sketchbook\libraries -fqbn=arduino:samd:arduino_zero_edbg -vid-pid=0X03EB_0X2157 -ide-version=10805 -build-path C:\Users\misu\AppData\Local\Temp\arduino_build_67329 -warnings=none -build-cache C:\Users\misu\AppData\Local\Temp\arduino_cache_553178 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.CMSIS-Atmel.path=C:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\tools\CMSIS-Atmel\1.1.0 -prefs=runtime.tools.arduinoOTA.path=C:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\tools\arduinoOTA\1.2.0 -prefs=runtime.tools.openocd.path=C:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\tools\openocd\0.9.0-arduino6-static -prefs=runtime.tools.CMSIS.path=C:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\tools\CMSIS\4.5.0 -prefs=runtime.tools.arm-none-eabi-gcc.path=C:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.bossac.path=C:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\tools\bossac\1.7.0 -verbose C:\Users\misu\AppData\Local\Temp\arduino_modified_sketch_389744\sketch_mar17a.ino
C:\Users\misu\Desktop\arduino-1.8.5\arduino-builder -compile -logger=machine -hardware C:\Users\misu\Desktop\arduino-1.8.5\hardware -hardware C:\Users\misu\Desktop\arduino-1.8.5\portable\packages -tools C:\Users\misu\Desktop\arduino-1.8.5\tools-builder -tools C:\Users\misu\Desktop\arduino-1.8.5\hardware\tools\avr -tools C:\Users\misu\Desktop\arduino-1.8.5\portable\packages -built-in-libraries C:\Users\misu\Desktop\arduino-1.8.5\libraries -libraries C:\Users\misu\Desktop\arduino-1.8.5\portable\sketchbook\libraries -fqbn=arduino:samd:arduino_zero_edbg -vid-pid=0X03EB_0X2157 -ide-version=10805 -build-path C:\Users\misu\AppData\Local\Temp\arduino_build_67329 -warnings=none -build-cache C:\Users\misu\AppData\Local\Temp\arduino_cache_553178 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.CMSIS-Atmel.path=C:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\tools\CMSIS-Atmel\1.1.0 -prefs=runtime.tools.arduinoOTA.path=C:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\tools\arduinoOTA\1.2.0 -prefs=runtime.tools.openocd.path=C:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\tools\openocd\0.9.0-arduino6-static -prefs=runtime.tools.CMSIS.path=C:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\tools\CMSIS\4.5.0 -prefs=runtime.tools.arm-none-eabi-gcc.path=C:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1 -prefs=runtime.tools.bossac.path=C:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\tools\bossac\1.7.0 -verbose C:\Users\misu\AppData\Local\Temp\arduino_modified_sketch_389744\sketch_mar17a.ino
Using board 'arduino_zero_edbg' from platform in folder: C:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\hardware\samd\1.6.17
Using core 'arduino' from platform in folder: C:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\hardware\samd\1.6.17
Detecting libraries used...
"C:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions  -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10805 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD  -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSBCON '-DUSB_MANUFACTURER="Arduino LLC"' '-DUSB_PRODUCT="Arduino Zero"' "-IC:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\tools\CMSIS\4.5.0/CMSIS/Include/" "-IC:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\tools\CMSIS-Atmel\1.1.0/CMSIS/Device/ATMEL/" "-IC:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\hardware\samd\1.6.17\cores\arduino" "-IC:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\hardware\samd\1.6.17\variants\arduino_zero" "C:\Users\misu\AppData\Local\Temp\arduino_build_67329\sketch\sketch_mar17a.ino.cpp" -o "nul"
"C:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-g++" -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions  -w -x c++ -E -CC -DF_CPU=48000000L -DARDUINO=10805 -DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD  -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x804d -DUSBCON '-DUSB_MANUFACTURER="Arduino LLC"' '-DUSB_PRODUCT="Arduino Zero"' "-IC:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\tools\CMSIS\4.5.0/CMSIS/Include/" "-IC:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\tools\CMSIS-Atmel\1.1.0/CMSIS/Device/ATMEL/" "-IC:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\hardware\samd\1.6.17\cores\arduino" "-IC:\Users\misu\Desktop\arduino-1.8.5\portable\packages\arduino\hardware\samd\1.6.17\variants\arduino_zero" "C:\Users\misu\AppData\Local\Temp\arduino_build_67329\sketch\sketch_mar17a.ino.cpp" -o "C:\Users\misu\AppData\Local\Temp\arduino_build_67329\preproc\ctags_target_for_gcc_minus_e.cpp"
C:\Users\misu\AppData\Local\Temp\arduino_modified_sketch_389744\sketch_mar17a.ino:1:28: fatal error: SoftwareSerial.h: No such file or directory

 #include <SoftwareSerial.h>

                            ^

compilation terminated.

exit status 1
Error compiling for board Arduino/Genuino Zero (Programming Port).

Please help me i don’t know why this happens !
Thanks for the time!

Look at that last line:

C:\Users\misu\AppData\Local\Temp\arduino_modified_sketch_389744\sketch_mar17a.ino:1:28: fatal error: SoftwareSerial.h: No such file or directory

It's telling you SoftwareSerial isn't found. It is part of the Atmel libraries, not for SAMD.

There are 6 Serial Communication Channels on the SAMD21, each capable of operating as either a USART, I2C or SPI port.

So you should not use software serial but a hardware one

You can read this thread for more info