Trouble using USB_HOST_SHIELD 2.0

These are the logs when i try to upload the MouseController example from the library

Arduino: 1.8.19 (Windows 10), Board: "Arduino Leonardo"

In file included from C:\Users\noobz\Documents\Arduino\libraries\USBHost\src/MouseController.h:22:0,
                 from C:\Users\noobz\Documents\Arduino\libraries\USBHost\examples\MouseController\MouseController.ino:16:
C:\Users\noobz\Documents\Arduino\libraries\USBHost\src/hidboot.h: In member function 'virtual void HIDBoot<BOOT_PROTOCOL>::EndpointXtract(uint32_t, uint32_t, uint32_t, uint32_t, const USB_ENDPOINT_DESCRIPTOR*)':
C:\Users\noobz\Documents\Arduino\libraries\USBHost\src/hidboot.h:474:62: error: 'UOTGHS_HSTPIPCFG_PTYPE_INTRPT' was not declared in this scope
   pipe = UHD_Pipe_Alloc(bAddress, epInfo[index].deviceEpNum, UOTGHS_HSTPIPCFG_PTYPE_INTRPT, UOTGHS_HSTPIPCFG_PTOKEN_IN, epInfo[index].maxPktSize, 10, UOTGHS_HSTPIPCFG_PBK_1_BANK);
                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\noobz\Documents\Arduino\libraries\USBHost\src/hidboot.h:474:93: error: 'UOTGHS_HSTPIPCFG_PTOKEN_IN' was not declared in this scope
   pipe = UHD_Pipe_Alloc(bAddress, epInfo[index].deviceEpNum, UOTGHS_HSTPIPCFG_PTYPE_INTRPT, UOTGHS_HSTPIPCFG_PTOKEN_IN, epInfo[index].maxPktSize, 10, UOTGHS_HSTPIPCFG_PBK_1_BANK);
                                                                                             ^~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\noobz\Documents\Arduino\libraries\USBHost\src/hidboot.h:474:151: error: 'UOTGHS_HSTPIPCFG_PBK_1_BANK' was not declared in this scope
   pipe = UHD_Pipe_Alloc(bAddress, epInfo[index].deviceEpNum, UOTGHS_HSTPIPCFG_PTYPE_INTRPT, UOTGHS_HSTPIPCFG_PTOKEN_IN, epInfo[index].maxPktSize, 10, UOTGHS_HSTPIPCFG_PBK_1_BANK);
                                                                                                                                                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\noobz\Documents\Arduino\libraries\USBHost\src/hidboot.h:474:10: warning: there are no arguments to 'UHD_Pipe_Alloc' that depend on a template parameter, so a declaration of 'UHD_Pipe_Alloc' must be available [-fpermissive]
   pipe = UHD_Pipe_Alloc(bAddress, epInfo[index].deviceEpNum, UOTGHS_HSTPIPCFG_PTYPE_INTRPT, UOTGHS_HSTPIPCFG_PTOKEN_IN, epInfo[index].maxPktSize, 10, UOTGHS_HSTPIPCFG_PBK_1_BANK);
          ^~~~~~~~~~~~~~
C:\Users\noobz\Documents\Arduino\libraries\USBHost\src/hidboot.h: In member function 'virtual uint32_t HIDBoot<BOOT_PROTOCOL>::Release()':
C:\Users\noobz\Documents\Arduino\libraries\USBHost\src/hidboot.h:500:2: warning: there are no arguments to 'UHD_Pipe_Free' that depend on a template parameter, so a declaration of 'UHD_Pipe_Free' must be available [-fpermissive]
  UHD_Pipe_Free(epInfo[epInterruptInIndex].hostPipeNum);
  ^~~~~~~~~~~~~
C:\Users\noobz\Documents\Arduino\libraries\USBHost\src/hidboot.h: In instantiation of 'uint32_t HIDBoot<BOOT_PROTOCOL>::Release() [with unsigned char BOOT_PROTOCOL = 2; uint32_t = long unsigned int]':
C:\Users\noobz\Documents\Arduino\libraries\USBHost\examples\MouseController\MouseController.ino:90:1:   required from here
C:\Users\noobz\Documents\Arduino\libraries\USBHost\src/hidboot.h:500:15: error: 'UHD_Pipe_Free' was not declared in this scope
  UHD_Pipe_Free(epInfo[epInterruptInIndex].hostPipeNum);
  ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\noobz\Documents\Arduino\libraries\USBHost\src/hidboot.h: In instantiation of 'void HIDBoot<BOOT_PROTOCOL>::EndpointXtract(uint32_t, uint32_t, uint32_t, uint32_t, const USB_ENDPOINT_DESCRIPTOR*) [with unsigned char BOOT_PROTOCOL = 2; uint32_t = long unsigned int]':
C:\Users\noobz\Documents\Arduino\libraries\USBHost\examples\MouseController\MouseController.ino:90:1:   required from here
C:\Users\noobz\Documents\Arduino\libraries\USBHost\src/hidboot.h:474:178: error: 'UHD_Pipe_Alloc' was not declared in this scope
   pipe = UHD_Pipe_Alloc(bAddress, epInfo[index].deviceEpNum, UOTGHS_HSTPIPCFG_PTYPE_INTRPT, UOTGHS_HSTPIPCFG_PTOKEN_IN, epInfo[index].maxPktSize, 10, UOTGHS_HSTPIPCFG_PBK_1_BANK);
                                                                                                                                                                                  ^
exit status 1
Error compiling for board Arduino Leonardo.


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

The code you are using is designed for Arduino Due or Zero. Use the IDE Library Manager to install the USB Host Shield Library 2.0 then use one of the HID mouse examples.