At the moment the IRLib2 library from cyborg5 is missing support for the ESP32 module.
I have updated the library so it supports the ESP32. Until cyborg5 merges my pull request you can find the updated code on my Github in the branch esp32-support.
Download
You can download the code here: download (mirror).
Installation
The installation instructions can be found in the included readme.md file. They are also available here: readme.md.
The default IR send GPIO pin is 26. This can be changed in the file: IRLibProtocols/IRLibESP32.h.
Trying to implement a trainable IR remote control on an M5Stick C. Help from any one, Please